mirror of
https://github.com/TangentFoxy/memex.git
synced 2024-11-22 04:54:23 +00:00
window.onload call msnry.layout() to fix image grid-item div squashed bug.
This commit is contained in:
parent
33ce689ac5
commit
a3bcd4f626
@ -30,13 +30,14 @@ function ViewMasonry()
|
|||||||
transitionDuration: 0,
|
transitionDuration: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
///////////////////////////
|
||||||
|
// Fix squashed image divs
|
||||||
var imgLoad = imagesLoaded('.grid');
|
var imgLoad = imagesLoaded('.grid');
|
||||||
function onAlways( instance )
|
imgLoad.on( 'always', function (instance) { parent.msnry.layout(); } );
|
||||||
{
|
// Above imgLoad on always msnry.layout() should work but occassionally doesn't in Chrome and NEVER does in Firefox.
|
||||||
this.msnry.layout();
|
window.onload = function () { parent.msnry.layout(); }
|
||||||
}
|
// msnry.layout() called by window onload fixes things but not ideal.
|
||||||
imgLoad.on( 'always', onAlways.bind(this) );
|
///////////////////////////
|
||||||
// imgLoad.off( 'always', onAlways );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user