Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery isotope: filter on page load based on get variable

I am working with the jQuery isotope plugin and would like to display only items from a particular group when the page loads. Currently all of the items are displaying:

http://aproposstudio.com/category/work/

For example, on the link above, is there a way to load the page with the 'murals' displaying?

thanks.

like image 981
superUntitled Avatar asked Jan 05 '12 19:01

superUntitled


2 Answers

The answer is quite easy:

$('#container').isotope({ filter: '.your-filter-name' });

Use this line in your code.

Refere this link: http://isotope.metafizzy.co/docs/filtering.html

like image 200
madvertising Avatar answered Oct 23 '22 12:10

madvertising


So i think you just want to use the simple hide() and show() methods

If you use the classes applied to your html elements, you can easily select them and hide them with the following jQuery lines.

$(".project").hide()
$(".murals").show()

now, what this will do is 'hide' all of the projects, and show only the murals.

Does that make sense?

like image 36
BananaNeil Avatar answered Oct 23 '22 11:10

BananaNeil