Requires

Provides

Chain.Wait.js

value, Adds a method to inject pauses between chained events.

License:
MIT-style license.
Authors:
Aaron Newton
  1. 27
  2. 28
  3. 29
  4. 30
  5. 31
  6. 32
  7. 33
  8. 34
  9. 35
  10. 36
  11. 37
  12. 38
  13. 39
  14. 40
  15. 41
  16. 42
  17. 43
  18. 44
  19. 45
  20. 46
  21. 47
  22. 48
  23. 49
  24. 50
  25. 51
  26. 52
  27. 53
  28. 54
  29. 55
  30. 56
  31. 57
  32. 58
  33. 59
  34. 60
  35. 61
  36. 62
  37. 63
  38. 64
  39. 65
  40. 66
(function(){ var wait = { wait: function(duration){ return this.chain(function(){ this.callChain.delay(duration == null ? 500 : duration, this); }.bind(this)); } }; Chain.implement(wait); if (window.Fx){ Fx.implement(wait); ['Css', 'Tween', 'Elements'].each(function(cls){ if (Fx[cls]) Fx[cls].implement(wait); }); } Element.implement({ chains: function(effects){ Array.from(effects || ['tween', 'morph', 'reveal']).each(function(effect){ effect = this.get(effect); if (!effect) return; effect.setOptions({ link:'chain' }); }, this); return this; }, pauseFx: function(duration, effect){ this.chains(effect).get(effect || 'tween').wait(duration); return this; } }); })();