Using FlexSlider on my site, I'm trying to get the height of the first image in the slider. I thought the following code would do the job, but it seems like the images are loaded very late, so that they have no height on this jQuery event. The code will return "0".
$(window).load(function() {
$(document).ready(function() {
var height = $(".flexslider>div>ul>li.flex-active-slide>a>img").height();
console.log(height);
});
});
But if I run this code in my browser console after the page has loaded, the correct height is returned.
How can I get the image height on page load/ready using jQuery or JavaScript?