title: How can I make my function to run the moment the page is running?
body: <p>I would like to make a function run the moment a person loads my page. No interactivity. The function is loading when someone clicks. I also would like to make the function loop after 1 minute and a half. I tried replacing "click" for window.onload and body.onload but as you may have noticed by now I am a true begginer with javascript. Can someone give me a hand please. For now all I have is this: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// Animate an element by adding a class to it:
  // Paramaters: 
  // anim: the class name to add
  // time: animation duration (optional, fallsback to the class)
  // cb: an optional callback function to happen once the animation ends
  $.fn.animatecss = function(anim, time, cb) {
  
      if (time) this.css('-webkit-transition', time / 1000 + 's');
      this.addClass(anim);
  
      if ($.isFunction(cb)) {
          setTimeout(function() {
              // Ensure that the element is available inside the callback.
              $(this).each(cb);
          }, (time) ? time : 5000);
      }
  
      return this;
  };
  
  $(document).ready(function() {
      $('.box')click(function() {
          $(this).animatecss('blur-out', 5000, function() {
              console.log('callback');
          });
      });
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.blur-out {
      -webkit-filter: blur(8px);
      -webkit-transform: scale(1.4, 1.4);
      -webkit-transition: all 5s ease-out;
      transition: all 5s ease-out;
      visibility: hidden;
  }
  
  .box {    
      background:#fff;  
      margin: 80px; 
     padding: 20px;    
      
  }
      </code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="box"&gt;
      &lt;img src="http://companionplants.com/images/small-plant2.jpg"&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>