Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Fade in images onload Re: Fade in images onload

#103500
Taufik Nurrohman
Participant

I would suggest using .show(), when the image has been loaded, trigger the masonry:

img.photo {display:none;}
$(function() {
$('img.photo').one("load", function() {
$(this).show(1000, function() { // Show the image when loaded
$(this).parents('#content').masonry({ // After that, trigger the .masonry()
itemSelector:"div.post",
isAnimated:true
});
});
}).each(function() {
if(this.complete) {
$(this).load();
}
});
});

PS:Add clear:both to your pagination:

#pagination {
...
clear:both;
}