jquery - Masonry v3.0.4 resizing -


i'm upgrading site masonry 2 masonry 3.

in masonry 2, using

$(window).bind('smartresize.masonry', function() {  //recalculate container width }); 

on page http://masonry.desandro.com/appendix.html#upgrading-from-v2 "smartresize jquery plugin has been removed" without more explanation.

smartresize.masonry perfect me, allowed me recalculate container width , masonry fit in new width without delay.

now v3, i'm doing:

container.masonry('bindresize');  $(window).resize(function() {  //recalculate container width }); 

these 2 separate events , there's small delay between 2 of them. seems bindresize not called same frequency $(window).resize(), wrong?

is there way smartresize doing?

the bad part new masonry, there's no onbeforeresize , onafterresize. installed plugin smartresize (debouncedresize) , disabled masonry's resizing event container.masonry('unbindresize'); refresh masonry's layout inside own resizing function.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -