Start a jQuery function on page display
Hello everybody,
I'm currently working on a animation whit jQuery to brighten up my website. I wrote a function for the animation and now I want to start it from the beginning. So that when the page is loaded, the animation will start.
On the internet I found a lot of documentation on how to do this, and I must say it works but not like I want it to work. I want to move a div whitout moving his container, in which it's placed. Could someone tell me how to do this, down below you'll find my current code;
- window.onload = function(){
- $(".step5_ball").animate({
- opacity: 1,
- marginTop: "0.6in",
- }, 1500, 'linear', function() {
- $(".step5_ball").after('<div>Animation complete.</div>');
- });
- }