Home › Forums › CSS › Fade in images onload › Re: Fade in images onload
May 26, 2012 at 12:02 am
#103500
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;
}