I'm trying to reproduce the effect our friend @Dr. Molle told us on this link. I have a div like this:
<div id="start_palmira">
<span>Palmira Interiores</span>
</div>
That I want to reproduce when the window loads. Our friend introduces us to the onclick event of that particular div, and I'm trying to do it on the onload event of the page.
I've tried this using jquery:
/* Start animation */
$("#start_palmira").ready(
function fx(o)
{
var $o=$(o);
$o.html($o.text().replace(/([\S])/g,'<span>$1</span>'));
$o.css('position','relative');
$('span',$o).stop().css({position:'relative',
opacity:0,
fontSize:84,
top:function(i){return Math.floor(Math.random()*500)*((i%2)?1:-1);},
left:function(i){return Math.floor(Math.random()*500)*((i%2)?1:-1);}
}).animate({opacity:1,fontSize:12,top:0,left:0},1000);
});
inside the
$(document).ready(function() { ... things happening .... });
method. But if I do it like that, my browser doesn't load, and finally it asks me to stop the script that is making my browser go slowly.
I also wanted to fire the event on the onload event of the body, but I have doubts on how to handle that.
NOTE: This is the link to the onclik event of the div of our friend. I want it to be an onload event: The onclick event!