I have a question, if i set a image height in css and try to get height/width i get different results in different browsers. Is there a way to get the same dimension in all brow
The images aren't loaded in document.ready
, you need to use the window.load
event to make sure they're present, like this:
$(window).load(function(){
$("#text").append($("#img_0").height());
$("#text").append($("#img_0").width());
});
Here's a quick read on the difference, the important part is that pictures are loaded.