I'm having problems getting an image size inside a list, using jQuery. I'm having no problem to get the li element sizes, but every time I try with the image, it returns 0. What should I do?
<ul class="company-list">
<li>
<img src="<?php echo APP_URL; ?>images/partnership/img_01.jpg" alt="" >
</li>
</ul>
$( "ul.company-list li img" ).each(function( index ) {
var imgHeight = $(this).height();
var imgWidth = $(this).width();
var imProp = imgWidth / imgHeight;
console.log(imgHeight);
});