Get Each Image Natural Height With jQuery

后端 未结 2 1975
栀梦
栀梦 2020-12-31 00:43

I have to read each images\' natural height and I should make calculations. However I have some problem with read to natural height.

$(\'div.imgkirp img\').e         


        
2条回答
  •  独厮守ぢ
    2020-12-31 00:44

    Try to use property naturalHeight of image, using the prop method of the jQuery

    $('div.imgkirp img').each(function(){
    
       console.log($(this).prop('naturalHeight'));
    });
    

提交回复
热议问题