I know this has been asked before, but all answers I find refer to changing the number of columns on a responsive isotope layout. The problem with this is that while resizing the browser, there are instances in which there is a gap in the container.
What I am after is using isotope + media queries so that the thumbs adjust to the container size while decreasing the number of columns on window resize.
$(document).ready(function () {
var $container = $('#right'); $container.isotope({ layoutMode: 'fitRows', itemSelector: '.thumbs', animationEngine: 'best-available', resizable: false, }); $(window).smartresize(function () { $container.isotope({ // update columnWidth to a percentage of container width masonry: { columnWidth: $container.width() / 3 } }); }); $(window).smartresize();
});
Here's my jsfiddle:
http://jsfiddle.net/Alga/K4EXU/2/
And it kind of works, but there are some strange transitions. I believe there is some colliding between the media query and isotope.
Can anyone help?
Many thanks!