Start a jQuery function on page display

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;

  1.     window.onload = function(){
  2.                                       $(".step5_ball").animate({ 
  3.                                             opacity: 1,
  4.                                             marginTop: "0.6in",
  5.                                     }, 1500, 'linear', function() {
  6.                                            $(".step5_ball").after('<div>Animation complete.</div>');
  7.                                                  });
  8.                                    }





    • Topic Participants

    • info