i have some jquery script which runs after the window has loaded
$(window).load( function() {
$('.picture a img').each(function(index) {
$(this).height(280);
if ($(this).width() > $(this).height()) {
alert("yes");
} else {
alert("no");
}
});
});
i always get a "no" from this when i know some of the images should be a "yes". When i trace the script in chrome i noticed that the $(this).width()
always returns a 0. ive googled around and some suggestions were that the images havent loaded but here ive used the window.load
method which i thought should run once everything has loaded. any ideas??
thanks for any help in advance