Function in function cycle
<p>i need to load PHP file with random image to <code>&lt;div&gt;</code> every 2 seconds with fade effect so i use javascript and jQuery. I write function to hide div, load file in, than show it and wait 2 seconds, then it should call function again, but it happend just once then it stop.</p>

<p>Here is the function:</p>

<pre><code>function random(){
   $("#randomImage1").animate({opacity: '0.0'}).load("../images/randomImage.php").animate({opacity: '1.0'}).delay(2000, function(){
   random();
});
random();
</code></pre>
