Masonry will now only refresh when the width of the screen changes.

This commit is contained in:
K. Nobel
2017-01-31 10:54:15 +01:00
parent 6e6bbf8d92
commit dee483e946

View File

@@ -33,11 +33,15 @@ $(window).on("load", function() {
});
var masonryMode = 0;
var windowWidth = $(window).width();
$(window).resize(function() {
clearTimeout(window.resizedFinished);
window.resizeFinished = setTimeout(function() {
if ($(window).width() != windowWidth) {
windowWidth = $(window).width();
masonry(masonryMode);
}
}, 250);
});