Jquery quicksand callback
-
22-06-2021 - |
Question
I am trying to return the number of elements after the quicksand has arranged them
http://razorjack.net/quicksand/
this should kinda work
function adjust_height (){
var getall = $('#wrapper .li').length;
console.log(getall);
}
$(".portfolio-content").quicksand($filteredData, {
duration: 800,
easing: 'easeInOutQuad',
adjustHeight:false
},function (){
adjust_height ();
});
but I am getting the previous set length , example , if there is 4 , and on click I have 2 ,the count is 4 , on next click count is 2 . seems like I am late with my count
what am I doing wrong ?
Solution
Look at this example: http://jsfiddle.net/EVagr/1/
Everything working as expected.
Try to update quicksand and jquery js files.
OTHER TIPS
In your Quicksand Callback function, under adjust_height();
add this:
var filteredSize = $filteredData.size();
alert(filteredSize);
// If the above var doesn't work, try this variant.
// var filteredSize = $($filteredData).size();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow