Reputation: 1812
I want to get image height and width when it is not set from height attribute and not also set in css. Real height and width of image which we get in dom tree or when browser render image with image's original height and width. I tried following but didn't worked,
$("#idname img").attr('height');
but this need height attribute to set in image<>
Upvotes: 0
Views: 129
Reputation: 3019
You can use the height method
$("#idname img").height()
but you have to call it in the window-load event (instead of the dom-ready) because images are not loaded in the dom.
$(window).load(function ()
Upvotes: 3