1

我试图在流沙安排它们之后返回元素的数量

http://razorjack.net/quicksand/

这应该有点工作

function adjust_height (){
                 var getall = $('#wrapper .li').length;
                 console.log(getall);
}
        $(".portfolio-content").quicksand($filteredData, {
            duration: 800,
            easing: 'easeInOutQuad',
            adjustHeight:false

        },function (){
                  adjust_height ();

               });  

但我得到了之前设置的长度,例如,如果有 4,点击时我有 2,计数为 4,下一次点击计数为 2。好像我的计数迟到了

我究竟做错了什么 ?

4

2 回答 2

1

在您的流沙回调函数中,adjust_height();添加以下内容:

var filteredSize = $filteredData.size();

alert(filteredSize);

// If the above var doesn't work, try this variant.
// var filteredSize = $($filteredData).size();
于 2012-07-20T21:45:42.443 回答
1

Look at this example: http://jsfiddle.net/EVagr/1/

Everything working as expected.

Try to update quicksand and jquery js files.

于 2012-07-20T21:55:09.183 回答