I am working on responsive layout, where I also use jQuery classification.
I use the following script to get the current column width.
var curWidth; var detector; detector = $('.magic-column'); curWidth = detector.outerWidth(true); $(window).resize(function(){ if(detector.outerWidth(true)!=curWidth){ curWidth = detector.outerWidth(true); } });
My JQuery Masonry init script is something like this.
$(window).load(function(){ $(function (){ $wall.masonry({ singleMode: true, columnWidth: curWidth,
My first script chooses the width correctly, but in the masonry this width is not updated ... How can I implement the load and resize function so that my curWidth is updated for Freemasonry, as well as when resizing the window
source share