First open limited item not all in jQuery Quicksand?

情到浓时终转凉″ 提交于 2019-12-08 12:28:50

问题


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:


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.



来源:https://stackoverflow.com/questions/11911256/first-open-limited-item-not-all-in-jquery-quicksand

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!