jquery - Masonry Plugin: Resizing div wont cause reshuffle -
have masonry items wrapped in 1000px wide div, have button resize div 2000x using jquery's addclass(), problem masonry won't reshuffle items fill 1000px space, know resize works because resizing browser window causes reshuffle.
masonry:
$(function(){ $('#container').masonry({ // options itemselector : '.item', columnwidth : 240 }); }); button:
$("a.button").toggle(function(){ $(this).addclass("flip"); $("div#container").fadeout("fast", function() { $(this).fadein("fast").addclass("resize"); }); css:
width: 1000px; /* default */ width: 2000px !important; /* on button press */ i tried running ('a').click on masonry function using same button, , seems work problem still there.
any advice? i'm stumped :/
i believe need run masonry function agian when re-size button clicked.
$("a.button").toggle(function(){ $(this).addclass("flip"); $("div#container").fadeout("fast", function() { $(this).fadein("fast").addclass("resize"); // run masonry again $('#container').masonry({ itemselector : '.item', columnwidth : 240 }); });
Comments
Post a Comment