pausa con jquery

by cristian_cena

HTML

<div id="test"></div>

CSS

#test{
    width:100px; height:100px; background:green;
}

JavaScript

//función pause.
$.fn.pause = function(duration) { 
  $(this).animate({ dummy: 1 }, duration); 
  return this; 
}; 

//llamamos a pause() y lo asociamos a #test dentro del evento ready() asociado a document.
$(document).ready(function(){ 
    $("#test").pause(5000).fadeOut(240); // donde 1000 es igual a 1 segundo.
});