SHARE
TWEET

Untitled

a guest Nov 14th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $('.cellcontent').animate({
  2.    left: '-=190'}, {
  3.    easing: alert('start ani'),
  4.    duration: 5000,
  5.    complete: alert('end ani')});
  6.    
  7. complete:  function() { alert('end ani'); }
  8.    
  9. alert('start ani');
  10. $('.cellcontent').animate({
  11.      left: '-=190'
  12.    },
  13.    {
  14.      easing: 'swing',
  15.      duration: 5000,
  16.      complete: function(){
  17.         alert('end ani');
  18.     }
  19. });
  20.    
  21. $('.cellcontent').animate({
  22.     left: '-=190'}, {
  23.     easing: alert('start ani'),
  24.     duration: 5000,
  25.     complete: function() { alert('end ani') }
  26. });
  27.    
  28. $('.cellcontent').animate({
  29.     left: '-=190'}, {
  30.     easing: alert('start ani')
  31. }, duration).promise().done(function () {
  32.      alert('end animation');
  33. });
  34.    
  35. var onComplete = function () {
  36.     alert('end ani');
  37. };
  38.    
  39. $('.cellcontent').animate({
  40.     left: '-=190'}, {
  41.     easing:  'slow',
  42.     duration: 5000,
  43.     complete: onComplete //<-- function is passed as a variable, not called directly
  44.  });
  45.    
  46. $('.cellcontent').animate({
  47.   left: '-=190'}, {
  48.   easing:  'slow',
  49.   duration: 5000,
  50.   complete:  function () {
  51.         alert('end ani');
  52.   }
  53. });
  54.    
  55. $( "#clickme" ).click(function() {
  56.   $( "#book" ).animate({
  57.     opacity: 0.25,
  58.    left: "+=50",
  59.     height: "toggle"
  60.   }, 5000, function() {
  61.     // Animation complete.
  62.   });
  63. });
  64.    
  65. $('.cellcontent').animate({
  66.   left: '-=190',
  67.   easing:  'slow',
  68.   duration: 5000,
  69.   function () {
  70.     alert('end ani');
  71.   }
  72. });
RAW Paste Data
Top