Javascript image height and other calculation
<p>I was having a problem on getting the height and also calculating other calculations.</p>

<p>I want to get the image height after it has loaded, so I put it on the onload attribute of <code>&lt;img&gt;&lt;/img&gt;</code> function, here's my code</p>

<pre><code>&lt;p class="test1" style="position:absolute;bottom:0px;"&gt;
   &lt;img src="'+getBaseURL()+'js/check/no-image.png" rel="fullname"
        onload="verticalCenter()"/&gt;
&lt;/p&gt;

function verticalCenter(){
    var imageHeight = jQuery(".test1 img").height(); //I get a result of 0
    var total = imageHeight / 2 + 80
}
</code></pre>

<p>I already tried using setTimeout but it still fails.
What I was planning to do here is to set the css  of <code>&lt;p class="test1"&gt;</code> into like this:</p>

<pre><code>jQuery(".test1").css("bottom","-"+total);
</code></pre>

<p>As I said, this isn't working because I don't get a result in total.</p>

<p>How would I do this, Is there a way to solve this problems, I'm already scratching my head on this.</p>

<p>Thanks in advance!</p>
