当前位置:   article > 正文

jquery.superslide 参数分析

jquery.superslide 参数

插件中允许我们自定义的参数就下面这么多,但是,实现大多数功能都够了

  1. ! function (a) {
  2. a.fn.slide = function (b) {
  3. return a.fn.slide.defaults = {
  4. type: "slide",
  5. effect: "fade",
  6. autoPlay: !1,
  7. delayTime: 500,
  8. interTime: 2500,
  9. triggerTime: 150, //动作生效延时trigger
  10. defaultIndex: 0,
  11. titCell: ".hd li",
  12. mainCell: ".bd",
  13. targetCell: null,
  14. trigger: "mouseover",
  15. scroll: 1,
  16. vis: 1,
  17. titOnClassName: "on",
  18. autoPage: !1,
  19. prevCell: ".prev",
  20. nextCell: ".next",
  21. pageStateCell: ".pageState",
  22. opp: !1,
  23. pnLoop: !0,
  24. easing: "swing",
  25. startFun: null,
  26. endFun: null,
  27. switchLoad: null,
  28. playStateCell: ".playState",
  29. mouseOverStop: !0,
  30. defaultPlay: !0,
  31. returnDefault: !1
  32. }, this.each(function () {


动画效果effect

  1. switch (e) {
  2. case "fade":
  3. case "fold":
  4. case "top":
  5. case "left":
  6. case "slideDown":
  7. c(p * t);
  8. break;
  9. case "leftLoop":
  10. case "topLoop":
  11. c(P + $(O));
  12. break;
  13. case "leftMarquee":
  14. case "topMarquee":
  15. var d = "leftMarquee" == e ? l.css("left").replace("px", "") : l.css("top").replace("px", ""),
  16. f = "leftMarquee" == e ? D : C,
  17. g = P;
  18. if (0 != d % f) {
  19. var h = Math.abs(0 ^ d / f);
  20. g = 1 == p ? P + h : P + h - 1
  21. }
  22. c(g)
  23. }

过渡效果,

  1. }(jQuery), jQuery.easing.jswing = jQuery.easing.swing, jQuery.extend(jQuery.easing, {
  2. def: "easeOutQuad",
  3. swing: function (a, b, c, d, e) {
  4. return jQuery.easing[jQuery.easing.def](a, b, c, d, e)
  5. },
  6. easeInQuad: function (a, b, c, d, e) {
  7. return d * (b /= e) * b + c
  8. },
  9. easeOutQuad: function (a, b, c, d, e) {
  10. return -d * (b /= e) * (b - 2) + c
  11. },
  12. easeInOutQuad: function (a, b, c, d, e) {
  13. return (b /= e / 2) < 1 ? d / 2 * b * b + c : -d / 2 * (--b * (b - 2) - 1) + c
  14. },
  15. easeInCubic: function (a, b, c, d, e) {
  16. return d * (b /= e) * b * b + c
  17. },
  18. easeOutCubic: function (a, b, c, d, e) {
  19. return d * ((b = b / e - 1) * b * b + 1) + c
  20. },
  21. easeInOutCubic: function (a, b, c, d, e) {
  22. return (b /= e / 2) < 1 ? d / 2 * b * b * b + c : d / 2 * ((b -= 2) * b * b + 2) + c
  23. },
  24. easeInQuart: function (a, b, c, d, e) {
  25. return d * (b /= e) * b * b * b + c
  26. },
  27. easeOutQuart: function (a, b, c, d, e) {
  28. return -d * ((b = b / e - 1) * b * b * b - 1) + c
  29. },
  30. easeInOutQuart: function (a, b, c, d, e) {
  31. return (b /= e / 2) < 1 ? d / 2 * b * b * b * b + c : -d / 2 * ((b -= 2) * b * b * b - 2) + c
  32. },
  33. easeInQuint: function (a, b, c, d, e) {
  34. return d * (b /= e) * b * b * b * b + c
  35. },
  36. easeOutQuint: function (a, b, c, d, e) {
  37. return d * ((b = b / e - 1) * b * b * b * b + 1) + c
  38. },
  39. easeInOutQuint: function (a, b, c, d, e) {
  40. return (b /= e / 2) < 1 ? d / 2 * b * b * b * b * b + c : d / 2 * ((b -= 2) * b * b * b * b + 2) + c
  41. },
  42. easeInSine: function (a, b, c, d, e) {
  43. return -d * Math.cos(b / e * (Math.PI / 2)) + d + c
  44. },
  45. easeOutSine: function (a, b, c, d, e) {
  46. return d * Math.sin(b / e * (Math.PI / 2)) + c
  47. },
  48. easeInOutSine: function (a, b, c, d, e) {
  49. return -d / 2 * (Math.cos(Math.PI * b / e) - 1) + c
  50. },
  51. easeInExpo: function (a, b, c, d, e) {
  52. return 0 == b ? c : d * Math.pow(2, 10 * (b / e - 1)) + c
  53. },
  54. easeOutExpo: function (a, b, c, d, e) {
  55. return b == e ? c + d : d * (-Math.pow(2, -10 * b / e) + 1) + c
  56. },
  57. easeInOutExpo: function (a, b, c, d, e) {
  58. return 0 == b ? c : b == e ? c + d : (b /= e / 2) < 1 ? d / 2 * Math.pow(2, 10 * (b - 1)) + c : d / 2 * (-Math.pow(2, -10 * --b) + 2) + c
  59. },
  60. easeInCirc: function (a, b, c, d, e) {
  61. return -d * (Math.sqrt(1 - (b /= e) * b) - 1) + c
  62. },
  63. easeOutCirc: function (a, b, c, d, e) {
  64. return d * Math.sqrt(1 - (b = b / e - 1) * b) + c
  65. },
  66. easeInOutCirc: function (a, b, c, d, e) {
  67. return (b /= e / 2) < 1 ? -d / 2 * (Math.sqrt(1 - b * b) - 1) + c : d / 2 * (Math.sqrt(1 - (b -= 2) * b) + 1) + c
  68. },
  69. easeInElastic: function (a, b, c, d, e) {
  70. var f = 1.70158,
  71. g = 0,
  72. h = d;
  73. if (0 == b) return c;
  74. if (1 == (b /= e)) return c + d;
  75. if (g || (g = .3 * e), h < Math.abs(d)) {
  76. h = d;
  77. var f = g / 4
  78. } else var f = g / (2 * Math.PI) * Math.asin(d / h);
  79. return -(h * Math.pow(2, 10 * (b -= 1)) * Math.sin((b * e - f) * 2 * Math.PI / g)) + c
  80. },
  81. easeOutElastic: function (a, b, c, d, e) {
  82. var f = 1.70158,
  83. g = 0,
  84. h = d;
  85. if (0 == b) return c;
  86. if (1 == (b /= e)) return c + d;
  87. if (g || (g = .3 * e), h < Math.abs(d)) {
  88. h = d;
  89. var f = g / 4
  90. } else var f = g / (2 * Math.PI) * Math.asin(d / h);
  91. return h * Math.pow(2, -10 * b) * Math.sin((b * e - f) * 2 * Math.PI / g) + d + c
  92. },
  93. easeInOutElastic: function (a, b, c, d, e) {
  94. var f = 1.70158,
  95. g = 0,
  96. h = d;
  97. if (0 == b) return c;
  98. if (2 == (b /= e / 2)) return c + d;
  99. if (g || (g = e * .3 * 1.5), h < Math.abs(d)) {
  100. h = d;
  101. var f = g / 4
  102. } else var f = g / (2 * Math.PI) * Math.asin(d / h);
  103. return 1 > b ? -.5 * h * Math.pow(2, 10 * (b -= 1)) * Math.sin((b * e - f) * 2 * Math.PI / g) + c : .5 * h * Math.pow(2, -10 * (b -= 1)) * Math.sin((b * e - f) * 2 * Math.PI / g) + d + c
  104. },
  105. easeInBack: function (a, b, c, d, e, f) {
  106. return void 0 == f && (f = 1.70158), d * (b /= e) * b * ((f + 1) * b - f) + c
  107. },
  108. easeOutBack: function (a, b, c, d, e, f) {
  109. return void 0 == f && (f = 1.70158), d * ((b = b / e - 1) * b * ((f + 1) * b + f) + 1) + c
  110. },
  111. easeInOutBack: function (a, b, c, d, e, f) {
  112. return void 0 == f && (f = 1.70158), (b /= e / 2) < 1 ? d / 2 * b * b * (((f *= 1.525) + 1) * b - f) + c : d / 2 * ((b -= 2) * b * (((f *= 1.525) + 1) * b + f) + 2) + c
  113. },
  114. easeInBounce: function (a, b, c, d, e) {
  115. return d - jQuery.easing.easeOutBounce(a, e - b, 0, d, e) + c
  116. },
  117. easeOutBounce: function (a, b, c, d, e) {
  118. return (b /= e) < 1 / 2.75 ? d * 7.5625 * b * b + c : 2 / 2.75 > b ? d * (7.5625 * (b -= 1.5 / 2.75) * b + .75) + c : 2.5 / 2.75 > b ? d * (7.5625 * (b -= 2.25 / 2.75) * b + .9375) + c : d * (7.5625 * (b -= 2.625 / 2.75) * b + .984375) + c
  119. },
  120. easeInOutBounce: function (a, b, c, d, e) {
  121. return e / 2 > b ? .5 * jQuery.easing.easeInBounce(a, 2 * b, 0, d, e) + c : .5 * jQuery.easing.easeOutBounce(a, 2 * b - e, 0, d, e) + .5 * d + c
  122. }
  123. });







声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/120695
推荐阅读
相关标签
  

闽ICP备14008679号