I posted a video explaining my problem. Sorry for the slow frame rate.
When I squeeze the window too fast, the jQuery plugin for Freemasonry seems too slow to keep up and therefore breaks the layout when the browser changes too fast. Some elements fall below the footer, and this looks obviously wrong.
When I reload the page, as seen in the video, the layout returns to its normal state.
I think this is smartresize problem
Here is a demo page: http://test.davewhitley.com/not-wp/isotope_test/index.php
This page successfully does this: http://tympanus.net/codrops/collective/collective-2/
javascript:
jQuery(document).ready(function($) { var CollManag = (function() { var $ctCollContainer = $('#ct-coll-container'), collCnt = 1, init = function() { changeColCnt(); initEvents(); initPlugins(); }, changeColCnt = function() { var w_w = $(window).width(); if( w_w <= 600 ) n = 2; else if( w_w <= 768 ) n = 3; else n = 4; }, initEvents = function() { $(window).on( 'smartresize.CollManag', function( event ) { changeColCnt(); }); }, initPlugins = function() { $ctCollContainer.imagesLoaded( function(){ $ctCollContainer.masonry({ itemSelector : '.ct-coll-item', columnWidth : function( containerWidth ) { return containerWidth / n; }, isAnimated : true, animationOptions: { duration: 300 } }); }); $ctCollContainer.colladjust(); $ctCollContainer.find('div.ct-coll-item-multi').collslider(); }; return { init: init }; })(); CollManag.init(); });
source share