mercredi 8 avril 2015

Different result for Image width and height each time in JQuery

Its very weird for me, as I'm changing width and height of the loaded image which run in document.ready(). Every time the function runs,the image width and height is different.


I use this code for getting width and height for loaded image :



var img = document.getElementById('imgLogo');
var width = img.clientWidth;
var height = img.clientHeight;


This is the Fiddle link: http://ift.tt/1ILPW2c


Also, the result is different in each browser.


Thank you in advanced for any help.


Aucun commentaire:

Enregistrer un commentaire