I want to get a image's width when a page loaded. Because the image's width is used to judge some conditions, the logic like this:
var width = $('img').width();
var height = $('img').height();
if(width > height){
//do fn1
}else{
//do fn2
}
Here is a link to simulate my problem. I knew if use function setTimeout
delay to
get image width is available but it's not precise.