title: JS/PHP: Is there any way to get image height without waiting for window to load first?
body: <p>I've got an image and I want to fire a JS function - but it's dependant on the height of the image. Something like below:</p>
  
  <pre><code>if($(".displayArea").find("img").height() &gt; 500){
       //Important function comes in...
       myFunction();
  }
  </code></pre>
  
  <p>The problem is I have to use <code>$(window).load()</code> to get the height of the image and that takes a long time, I'd like to be able to fire <code>myFunction()</code> on <code>$(document).ready()</code> and not later. </p>
  
  <p>Is there anyway to use <code>JS/jQuery or PHP</code> to figure out that the image will be more or less than 500px and fire the function accordingly? </p>