Reputation: 11
Hello im trying to get image height from an position absolute image but if i try to get the image value outside of the function it returns 0?
http://jsfiddle.net/vvorqo2c/4/
console.log($('.inner-slider .active img').height());
Upvotes: 1
Views: 77
Reputation: 190907
You should wait for the image to load. Here is a quick example.
$('img').on('load', function() {
console.log($(this).height());
});
Upvotes: 4