First open limited item not all in jQuery Quicksand?

506 Views Asked by At

jQuery Quicksand

I want to first open limited item like "vogue". in here ist open "all" What the change in the programs? Please help me

For looking go here1

go here2

1

There are 1 best solutions below

1
Joel Purra On

If you don't want all to show all items when you open the page, you can call the .quicksand() function for .vouge on page load, to trigger the filtering/animation.

Since the example with "vogue" is not trivial, I chose to reuse the click event handler. Put this code last in your javascript.

$(function() {
    // It would be better to create a function for this, but
    // to avoid code duplication the click() event is triggered/reused
    $('#filterOptions li a.vogue').click();
});

This is of course only a quick fix. It would be better to create a proper function of the contents of the click event, and call the function both on load and on click.