English 中文(简体)
Jquery Isotope 检查箱过滤
原标题:Jquery Isotope Checkbox filtering

I m 采用jQuery同位素。 一切都是ok,但我对过滤有问题。 我想使用多种类型,我有5个检查箱,我可以同时使用。 我能做些什么?

$("#classic").click(function() {
    if($("#classic").is(":checked")) {
    $( #box ).isotope({ filter:  .classic  });
    } else {
    $( #box ).isotope({ filter:    });
    }
});

我的项目=a,b,c,d,e,f,g,h

= x (a,b,e) y (c,h) z(d,f,g)

现在,如果我选择X和z检查箱,它只显示a,b,e,d,f,g

但我可以这样做。 我怎么办?

最佳回答

就像你一样,在法典中也有一小差错,在某个地方,古典被用作一种id,在另一个地方被用作一种 class。 如果情况并非如此,也想找到。 引证。

function checkIsoTope(){
    var ids = [];
    $("#classic, #den, #wer").filter(":checked").each(function(){
      ids.push("." + this.id);
    });    
    $( #box ).isotope({ filter: ids.join( , )});
}
$("#classic, #den, #wer, #allCheckboxId").click(checkIsoTope);
问题回答

Here is a solution for checkbox filtering: http://jsfiddle.net/3nY9V/6/





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签