[Bug] [Simple Masonry] Wrong calculation of margin if image is not fully loaded
-
Hi,
if an image is not fully loaded the resulting value for its
margin-top
is not correct as$img.height()
returns a wrong value in first place.I guess this happens because the function
resizeMasonry
(simple-masonry.js) is called on$(document).ready
instead of$(window).load
.In cases where code relies on loaded assets (for example, if the dimensions of an image are required), the code should be placed in a handler for the
load
event instead. (.ready())Alternatively the problem could be resolved by replacing
$img.height()
by$img.attr('height')
.Best regards,
Jay
- The topic ‘[Bug] [Simple Masonry] Wrong calculation of margin if image is not fully loaded’ is closed to new replies.