javascript - Isotope Filtering in Jquery -
I am trying to create a filter in which query and the following code works. How do I want to apply it to work with isotopic filtering.
HTML:
& lt; div class = "tags" & gt; & Lt; Label & gt; & Lt; Input type = "checkbox" rel = "flower" /> Flower & lt; / Labels & gt; & Lt; Label & gt; & Lt; Input type = "checkbox" rel = "plants" /> Plants & lt; / Labels & gt; & Lt; Label & gt; & Lt; Input type = "checkbox" rel = "beach" /> Between and lieutenant; / Labels & gt; & Lt; / Div & gt; & Lt; div square = "photo plant flowers" style = "width: px; height: px;" & Gt; Image 1 & lt; / Div & gt; & Lt; div square = "photo flower beach" style = "width: px; height: px;" & Gt; Image 2 & lt; / Div & gt; jQuery:
$ (function () {$ ('div.tags') .rep ('input: checkbox', 'change', Function () {var $ lis = $ ('. Photo'). Hide (); // $ ('input: check') for each check. Each (function () {$ lis.filter ('.' + $ (This) .attr ('rel')). Show ();});});}); I can not do isotope filtering to work.
Here it is.
I do not know if I understand your question correctly and if it will help you
But this can be a solution
ex> & lt; script type = "text / javascript" & gt; $ (document) .ready (function () {var $ container = $ ('# Container') var $ checkbox = $ ('div.tags input') $ container.isotope ({item selector: '.item'}); $ checkboxes.change (function () {var arr = []; $ Checkboxes.filter (': check') Each (function () {arr.push (this.value);}); arr = arr.join (','); $ container.isotope ({filter: arr} );});}); & Lt; / scripts & gt; If this solution does not meet your needs, then I apologize for you losing the time.
Comments
Post a Comment