jquery.SuperSlide.2.1.1.source.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. /*!
  2. * SuperSlide v2.1.1
  3. * 轻松解决网站大部分特效展示问题
  4. * 详尽信息请看官网:http://www.SuperSlide2.com/
  5. *
  6. * Copyright 2011-2013, 大话主席
  7. *
  8. * 请尊重原创,保留头部版权
  9. * 在保留版权的前提下可应用于个人或商业用途
  10. * v2.1.1:修复当调用多个SuperSlide,并设置returnDefault:true 时返回defaultIndex索引错误
  11. */
  12. (function($){
  13. $.fn.slide=function(options){
  14. $.fn.slide.defaults={
  15. type:"slide",
  16. effect:"fade",
  17. autoPlay:false,
  18. delayTime:500,
  19. interTime:2500,
  20. triggerTime:150,
  21. defaultIndex:0,
  22. titCell:".hd li",
  23. mainCell:".bd",
  24. targetCell:null,
  25. trigger:"mouseover",
  26. scroll:1,
  27. vis:1,
  28. titOnClassName:"on",
  29. autoPage:false,
  30. prevCell:".prev",
  31. nextCell:".next",
  32. pageStateCell:".pageState",
  33. opp: false,
  34. pnLoop:true,
  35. easing:"swing",
  36. startFun:null,
  37. endFun:null,
  38. switchLoad:null,
  39. playStateCell:".playState",
  40. mouseOverStop:true,
  41. defaultPlay:true,
  42. returnDefault:false
  43. };
  44. return this.each(function() {
  45. var opts = $.extend({},$.fn.slide.defaults,options);
  46. var slider = $(this);
  47. var effect = opts.effect;
  48. var prevBtn = $(opts.prevCell, slider);
  49. var nextBtn = $(opts.nextCell, slider);
  50. var pageState = $(opts.pageStateCell, slider);
  51. var playState = $(opts.playStateCell, slider);
  52. var navObj = $(opts.titCell, slider);//导航子元素结合
  53. var navObjSize = navObj.size();
  54. var conBox = $(opts.mainCell , slider);//内容元素父层对象
  55. var conBoxSize=conBox.children().size();
  56. var sLoad=opts.switchLoad;
  57. var tarObj = $(opts.targetCell, slider);
  58. /*字符串转换*/
  59. var index=parseInt(opts.defaultIndex);
  60. var delayTime=parseInt(opts.delayTime);
  61. var interTime=parseInt(opts.interTime);
  62. var triggerTime=parseInt(opts.triggerTime);
  63. var scroll=parseInt(opts.scroll);
  64. var vis=parseInt(opts.vis);
  65. var autoPlay = (opts.autoPlay=="false"||opts.autoPlay==false)?false:true;
  66. var opp = (opts.opp=="false"||opts.opp==false)?false:true;
  67. var autoPage = (opts.autoPage=="false"||opts.autoPage==false)?false:true;
  68. var pnLoop = (opts.pnLoop=="false"||opts.pnLoop==false)?false:true;
  69. var mouseOverStop = (opts.mouseOverStop=="false"||opts.mouseOverStop==false)?false:true;
  70. var defaultPlay = (opts.defaultPlay=="false"||opts.defaultPlay==false)?false:true;
  71. var returnDefault = (opts.returnDefault=="false"||opts.returnDefault==false)?false:true;
  72. var slideH=0;
  73. var slideW=0;
  74. var selfW=0;
  75. var selfH=0;
  76. var easing=opts.easing;
  77. var inter=null;//autoPlay-setInterval
  78. var mst =null;//trigger-setTimeout
  79. var rtnST=null;//returnDefault-setTimeout
  80. var titOn = opts.titOnClassName;
  81. var onIndex = navObj.index( slider.find( "."+titOn) );
  82. var oldIndex = index = onIndex==-1?index:onIndex;
  83. var defaultIndex = index;
  84. var _ind = index;
  85. var cloneNum = conBoxSize>=vis?( conBoxSize%scroll!=0?conBoxSize%scroll:scroll):0;
  86. var _tar;
  87. var isMarq = effect=="leftMarquee" || effect=="topMarquee"?true:false;
  88. var doStartFun=function(){ if ( $.isFunction( opts.startFun) ){ opts.startFun( index,navObjSize,slider,$(opts.titCell, slider),conBox,tarObj,prevBtn,nextBtn ) } }
  89. var doEndFun=function(){ if ( $.isFunction( opts.endFun ) ){ opts.endFun( index,navObjSize,slider,$(opts.titCell, slider),conBox,tarObj,prevBtn,nextBtn ) } }
  90. var resetOn=function(){ navObj.removeClass(titOn); if( defaultPlay ) navObj.eq(defaultIndex).addClass(titOn) }
  91. //单独处理菜单效果
  92. if( opts.type=="menu" ){
  93. if( defaultPlay ){ navObj.removeClass(titOn).eq(index).addClass(titOn); }
  94. navObj.hover(
  95. function(){
  96. _tar=$(this).find( opts.targetCell );
  97. var hoverInd =navObj.index($(this));
  98. mst = setTimeout(function(){
  99. index=hoverInd;
  100. navObj.removeClass(titOn).eq (index).addClass(titOn);
  101. doStartFun();
  102. switch (effect)
  103. {
  104. case "fade":_tar.stop(true,true).animate({opacity:"show"}, delayTime,easing,doEndFun ); break;
  105. case "slideDown":_tar.stop(true,true).animate({height:"show"}, delayTime,easing,doEndFun ); break;
  106. }
  107. } ,opts.triggerTime);
  108. },function(){
  109. clearTimeout(mst);
  110. switch (effect){ case "fade":_tar.animate( {opacity:"hide"},delayTime,easing ); break; case "slideDown":_tar.animate( {height:"hide"},delayTime,easing ); break; }
  111. }
  112. );
  113. if (returnDefault){
  114. slider.hover(function(){clearTimeout(rtnST);},function(){ rtnST = setTimeout( resetOn,delayTime ); });
  115. }
  116. return;
  117. }
  118. //处理分页
  119. if( navObjSize==0 )navObjSize=conBoxSize;//只有左右按钮
  120. if( isMarq ) navObjSize=2;
  121. if( autoPage ){
  122. if(conBoxSize>=vis){
  123. if( effect=="leftLoop" || effect=="topLoop" ){ navObjSize=conBoxSize%scroll!=0?(conBoxSize/scroll^0)+1:conBoxSize/scroll; }
  124. else{
  125. var tempS = conBoxSize-vis;
  126. navObjSize=1+parseInt(tempS%scroll!=0?(tempS/scroll+1):(tempS/scroll));
  127. if(navObjSize<=0)navObjSize=1;
  128. }
  129. }
  130. else{ navObjSize=1 }
  131. navObj.html("");
  132. var str="";
  133. if( opts.autoPage==true || opts.autoPage=="true" ){ for( var i=0; i<navObjSize; i++ ){ str+="<li>"+(i+1)+"</li>" } }
  134. else{ for( var i=0; i<navObjSize; i++ ){ str+=opts.autoPage.replace("$",(i+1)) } }
  135. navObj.html(str);
  136. var navObj = navObj.children();//重置导航子元素对象
  137. }
  138. if(conBoxSize>=vis){ //当内容个数少于可视个数,不执行效果。
  139. conBox.children().each(function(){ //取最大值
  140. if( $(this).width()>selfW ){ selfW=$(this).width(); slideW=$(this).outerWidth(true); }
  141. if( $(this).height()>selfH ){ selfH=$(this).height(); slideH=$(this).outerHeight(true); }
  142. });
  143. var _chr = conBox.children();
  144. var cloneEle = function(){
  145. for( var i=0; i<vis ; i++ ){ _chr.eq(i).clone().addClass("clone").appendTo(conBox); }
  146. for( var i=0; i<cloneNum ; i++ ){ _chr.eq(conBoxSize-i-1).clone().addClass("clone").prependTo(conBox); }
  147. }
  148. switch(effect)
  149. {
  150. case "fold": conBox.css({"position":"relative","width":slideW,"height":slideH}).children().css( {"position":"absolute","width":selfW,"left":0,"top":0,"display":"none"} ); break;
  151. case "top": conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; height:'+vis*slideH+'px"></div>').css( { "top":-(index*scroll)*slideH, "position":"relative","padding":"0","margin":"0"}).children().css( {"height":selfH} ); break;
  152. case "left": conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; width:'+vis*slideW+'px"></div>').css( { "width":conBoxSize*slideW,"left":-(index*scroll)*slideW,"position":"relative","overflow":"hidden","padding":"0","margin":"0"}).children().css( {"float":"left","width":selfW} ); break;
  153. case "leftLoop":
  154. case "leftMarquee":
  155. cloneEle();
  156. conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; width:'+vis*slideW+'px"></div>').css( { "width":(conBoxSize+vis+cloneNum)*slideW,"position":"relative","overflow":"hidden","padding":"0","margin":"0","left":-(cloneNum+index*scroll)*slideW}).children().css( {"float":"left","width":selfW} ); break;
  157. case "topLoop":
  158. case "topMarquee":
  159. cloneEle();
  160. conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; height:'+vis*slideH+'px"></div>').css( { "height":(conBoxSize+vis+cloneNum)*slideH,"position":"relative","padding":"0","margin":"0","top":-(cloneNum+index*scroll)*slideH}).children().css( {"height":selfH} ); break;
  161. }
  162. }
  163. //针对leftLoop、topLoop的滚动个数
  164. var scrollNum=function(ind){
  165. var _tempCs= ind*scroll;
  166. if( ind==navObjSize ){ _tempCs=conBoxSize; }else if( ind==-1 && conBoxSize%scroll!=0){ _tempCs=-conBoxSize%scroll; }
  167. return _tempCs;
  168. }
  169. //切换加载
  170. var doSwitchLoad=function(objs){
  171. var changeImg=function(t){
  172. for ( var i= t; i<( vis+ t); i++ ){
  173. objs.eq(i).find("img["+sLoad+"]").each(function(){
  174. var _this = $(this);
  175. _this.attr("src",_this.attr(sLoad)).removeAttr(sLoad);
  176. if( conBox.find(".clone")[0] ){ //如果存在.clone
  177. var chir = conBox.children();
  178. for ( var j=0 ; j< chir.size() ; j++ )
  179. {
  180. chir.eq(j).find("img["+sLoad+"]").each(function(){
  181. if( $(this).attr(sLoad)==_this.attr("src") ) $(this).attr("src",$(this).attr(sLoad)).removeAttr(sLoad)
  182. })
  183. }
  184. }
  185. })
  186. }
  187. }
  188. switch(effect)
  189. {
  190. case "fade": case "fold": case "top": case "left": case "slideDown":
  191. changeImg( index*scroll );
  192. break;
  193. case "leftLoop": case "topLoop":
  194. changeImg( cloneNum+scrollNum(_ind) );
  195. break;
  196. case "leftMarquee":case "topMarquee":
  197. var curS = effect=="leftMarquee"? conBox.css("left").replace("px",""):conBox.css("top").replace("px","");
  198. var slideT = effect=="leftMarquee"? slideW:slideH;
  199. var mNum=cloneNum;
  200. if( curS%slideT!=0 ){
  201. var curP = Math.abs(curS/slideT^0);
  202. if( index==1 ){ mNum=cloneNum+curP }else{ mNum=cloneNum+curP-1 }
  203. }
  204. changeImg( mNum );
  205. break;
  206. }
  207. }//doSwitchLoad end
  208. //效果函数
  209. var doPlay=function(init){
  210. // 当前页状态不触发效果
  211. if( defaultPlay && oldIndex==index && !init && !isMarq ) return;
  212. //处理页码
  213. if( isMarq ){ if ( index>= 1) { index=1; } else if( index<=0) { index = 0; } }
  214. else{
  215. _ind=index; if ( index >= navObjSize) { index = 0; } else if( index < 0) { index = navObjSize-1; }
  216. }
  217. doStartFun();
  218. //处理切换加载
  219. if( sLoad!=null ){ doSwitchLoad( conBox.children() ) }
  220. //处理targetCell
  221. if(tarObj[0]){
  222. _tar = tarObj.eq(index);
  223. if( sLoad!=null ){ doSwitchLoad( tarObj ) }
  224. if( effect=="slideDown" ){
  225. tarObj.not(_tar).stop(true,true).slideUp(delayTime);
  226. _tar.slideDown( delayTime,easing,function(){ if(!conBox[0]) doEndFun() });
  227. }
  228. else{
  229. tarObj.not(_tar).stop(true,true).hide();
  230. _tar.animate({opacity:"show"},delayTime,function(){ if(!conBox[0]) doEndFun() });
  231. }
  232. }
  233. if(conBoxSize>=vis){ //当内容个数少于可视个数,不执行效果。
  234. switch (effect)
  235. {
  236. case "fade":conBox.children().stop(true,true).eq(index).animate({opacity:"show"},delayTime,easing,function(){doEndFun()}).siblings().hide(); break;
  237. case "fold":conBox.children().stop(true,true).eq(index).animate({opacity:"show"},delayTime,easing,function(){doEndFun()}).siblings().animate({opacity:"hide"},delayTime,easing);break;
  238. case "top":conBox.stop(true,false).animate({"top":-index*scroll*slideH},delayTime,easing,function(){doEndFun()});break;
  239. case "left":conBox.stop(true,false).animate({"left":-index*scroll*slideW},delayTime,easing,function(){doEndFun()});break;
  240. case "leftLoop":
  241. var __ind = _ind;
  242. conBox.stop(true,true).animate({"left":-(scrollNum(_ind)+cloneNum)*slideW},delayTime,easing,function(){
  243. if( __ind<=-1 ){ conBox.css("left",-(cloneNum+(navObjSize-1)*scroll)*slideW); }else if( __ind>=navObjSize ){ conBox.css("left",-cloneNum*slideW); }
  244. doEndFun();
  245. });
  246. break;//leftLoop end
  247. case "topLoop":
  248. var __ind = _ind;
  249. conBox.stop(true,true).animate({"top":-(scrollNum(_ind)+cloneNum)*slideH},delayTime,easing,function(){
  250. if( __ind<=-1 ){ conBox.css("top",-(cloneNum+(navObjSize-1)*scroll)*slideH); }else if( __ind>=navObjSize ){ conBox.css("top",-cloneNum*slideH); }
  251. doEndFun();
  252. });
  253. break;//topLoop end
  254. case "leftMarquee":
  255. var tempLeft = conBox.css("left").replace("px","");
  256. if(index==0 ){
  257. conBox.animate({"left":++tempLeft},0,function(){
  258. if( conBox.css("left").replace("px","")>= 0){ conBox.css("left",-conBoxSize*slideW) }
  259. });
  260. }
  261. else{
  262. conBox.animate({"left":--tempLeft},0,function(){
  263. if( conBox.css("left").replace("px","")<= -(conBoxSize+cloneNum)*slideW){ conBox.css("left",-cloneNum*slideW) }
  264. });
  265. }break;// leftMarquee end
  266. case "topMarquee":
  267. var tempTop = conBox.css("top").replace("px","");
  268. if(index==0 ){
  269. conBox.animate({"top":++tempTop},0,function(){
  270. if( conBox.css("top").replace("px","")>= 0){ conBox.css("top",-conBoxSize*slideH) }
  271. });
  272. }
  273. else{
  274. conBox.animate({"top":--tempTop},0,function(){
  275. if( conBox.css("top").replace("px","")<= -(conBoxSize+cloneNum)*slideH){ conBox.css("top",-cloneNum*slideH) }
  276. });
  277. }break;// topMarquee end
  278. }//switch end
  279. }
  280. navObj.removeClass(titOn).eq(index).addClass(titOn);
  281. oldIndex=index;
  282. if( !pnLoop ){ //pnLoop控制前后按钮是否继续循环
  283. nextBtn.removeClass("nextStop"); prevBtn.removeClass("prevStop");
  284. if (index==0 ){ prevBtn.addClass("prevStop"); }
  285. if (index==navObjSize-1 ){ nextBtn.addClass("nextStop"); }
  286. }
  287. pageState.html( "<span>"+(index+1)+"</span>/"+navObjSize);
  288. };// doPlay end
  289. //初始化执行
  290. if( defaultPlay ){ doPlay(true); }
  291. if (returnDefault)//返回默认状态
  292. {
  293. slider.hover(function(){ clearTimeout(rtnST) },function(){
  294. rtnST = setTimeout( function(){
  295. index=defaultIndex;
  296. if(defaultPlay){ doPlay(); }
  297. else{
  298. if( effect=="slideDown" ){ _tar.slideUp( delayTime, resetOn ); }
  299. else{ _tar.animate({opacity:"hide"},delayTime,resetOn ); }
  300. }
  301. oldIndex=index;
  302. },300 );
  303. });
  304. }
  305. ///自动播放函数
  306. var setInter = function(time){ inter=setInterval(function(){ opp?index--:index++; doPlay() }, !!time?time:interTime); }
  307. var setMarInter = function(time){ inter = setInterval(doPlay, !!time?time:interTime); }
  308. // 处理mouseOverStop
  309. var resetInter = function(){ if( !mouseOverStop ){clearInterval(inter); setInter() } }
  310. // 前后按钮触发
  311. var nextTrigger = function(){ if ( pnLoop || index!=navObjSize-1 ){ index++; doPlay(); if(!isMarq)resetInter(); } }
  312. var prevTrigger = function(){ if ( pnLoop || index!=0 ){ index--; doPlay(); if(!isMarq)resetInter(); } }
  313. //处理playState
  314. var playStateFun = function(){ clearInterval(inter); isMarq?setMarInter():setInter(); playState.removeClass("pauseState") }
  315. var pauseStateFun = function(){ clearInterval(inter);playState.addClass("pauseState"); }
  316. //自动播放
  317. if (autoPlay) {
  318. if( isMarq ){
  319. opp?index--:index++; setMarInter();
  320. if(mouseOverStop) conBox.hover(pauseStateFun,playStateFun);
  321. }else{
  322. setInter();
  323. if(mouseOverStop) slider.hover( pauseStateFun,playStateFun );
  324. }
  325. }
  326. else{ if( isMarq ){ opp?index--:index++; } playState.addClass("pauseState"); }
  327. playState.click(function(){ playState.hasClass("pauseState")?playStateFun():pauseStateFun() });
  328. //titCell事件
  329. if(opts.trigger=="mouseover"){
  330. navObj.hover(function(){ var hoverInd = navObj.index(this); mst = setTimeout(function(){ index=hoverInd; doPlay(); resetInter(); },opts.triggerTime); }, function(){ clearTimeout(mst) });
  331. }else{ navObj.click(function(){ index=navObj.index(this); doPlay(); resetInter(); }) }
  332. //前后按钮事件
  333. if (isMarq){
  334. nextBtn.mousedown(nextTrigger);
  335. prevBtn.mousedown(prevTrigger);
  336. //前后按钮长按10倍加速
  337. if (pnLoop)
  338. {
  339. var st;
  340. var marDown = function(){ st=setTimeout(function(){ clearInterval(inter); setMarInter( interTime/10^0 ) },150) }
  341. var marUp = function(){ clearTimeout(st); clearInterval(inter); setMarInter() }
  342. nextBtn.mousedown(marDown); nextBtn.mouseup(marUp);
  343. prevBtn.mousedown(marDown); prevBtn.mouseup(marUp);
  344. }
  345. //前后按钮mouseover事件
  346. if( opts.trigger=="mouseover" ){ nextBtn.hover(nextTrigger,function(){}); prevBtn.hover(prevTrigger,function(){}); }
  347. }else{
  348. nextBtn.click(nextTrigger);
  349. prevBtn.click(prevTrigger);
  350. }
  351. });//each End
  352. };//slide End
  353. })(jQuery);
  354. jQuery.easing['jswing'] = jQuery.easing['swing'];
  355. jQuery.extend( jQuery.easing,
  356. {
  357. def: 'easeOutQuad',
  358. swing: function (x, t, b, c, d) { return jQuery.easing[jQuery.easing.def](x, t, b, c, d); },
  359. easeInQuad: function (x, t, b, c, d) {return c*(t/=d)*t + b;},
  360. easeOutQuad: function (x, t, b, c, d) {return -c *(t/=d)*(t-2) + b},
  361. easeInOutQuad: function (x, t, b, c, d) {if ((t/=d/2) < 1) return c/2*t*t + b;return -c/2 * ((--t)*(t-2) - 1) + b},
  362. easeInCubic: function (x, t, b, c, d) {return c*(t/=d)*t*t + b},
  363. easeOutCubic: function (x, t, b, c, d) {return c*((t=t/d-1)*t*t + 1) + b},
  364. easeInOutCubic: function (x, t, b, c, d) {if ((t/=d/2) < 1) return c/2*t*t*t + b;return c/2*((t-=2)*t*t + 2) + b},
  365. easeInQuart: function (x, t, b, c, d) {return c*(t/=d)*t*t*t + b},
  366. easeOutQuart: function (x, t, b, c, d) {return -c * ((t=t/d-1)*t*t*t - 1) + b},
  367. easeInOutQuart: function (x, t, b, c, d) {if ((t/=d/2) < 1) return c/2*t*t*t*t + b;return -c/2 * ((t-=2)*t*t*t - 2) + b},
  368. easeInQuint: function (x, t, b, c, d) {return c*(t/=d)*t*t*t*t + b},
  369. easeOutQuint: function (x, t, b, c, d) {return c*((t=t/d-1)*t*t*t*t + 1) + b},
  370. easeInOutQuint: function (x, t, b, c, d) {if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;return c/2*((t-=2)*t*t*t*t + 2) + b},
  371. easeInSine: function (x, t, b, c, d) {return -c * Math.cos(t/d * (Math.PI/2)) + c + b},
  372. easeOutSine: function (x, t, b, c, d) {return c * Math.sin(t/d * (Math.PI/2)) + b},
  373. easeInOutSine: function (x, t, b, c, d) {return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b},
  374. easeInExpo: function (x, t, b, c, d) {return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b},
  375. easeOutExpo: function (x, t, b, c, d) {return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b},
  376. easeInOutExpo: function (x, t, b, c, d) {if (t==0) return b;if (t==d) return b+c;if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;return c/2 * (-Math.pow(2, -10 * --t) + 2) + b},
  377. easeInCirc: function (x, t, b, c, d) {return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b},
  378. easeOutCirc: function (x, t, b, c, d) {return c * Math.sqrt(1 - (t=t/d-1)*t) + b},
  379. easeInOutCirc: function (x, t, b, c, d) {if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b},
  380. easeInElastic: function (x, t, b, c, d) {var s=1.70158;var p=0;var a=c;if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;if (a < Math.abs(c)) { a=c; var s=p/4; }
  381. else var s = p/(2*Math.PI) * Math.asin (c/a);return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b},
  382. easeOutElastic: function (x, t, b, c, d) {var s=1.70158;var p=0;var a=c;if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;if (a < Math.abs(c)) { a=c; var s=p/4; }
  383. else var s = p/(2*Math.PI) * Math.asin (c/a);return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b},
  384. easeInOutElastic: function (x, t, b, c, d) {var s=1.70158;var p=0;var a=c;if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);if (a < Math.abs(c)) { a=c; var s=p/4; }
  385. else var s = p/(2*Math.PI) * Math.asin (c/a);if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b},
  386. easeInBack: function (x, t, b, c, d, s) {if (s == undefined) s = 1.70158;return c*(t/=d)*t*((s+1)*t - s) + b},
  387. easeOutBack: function (x, t, b, c, d, s) {if (s == undefined) s = 1.70158;return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b},
  388. easeInOutBack: function (x, t, b, c, d, s) {if (s == undefined) s = 1.70158;
  389. if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b},
  390. easeInBounce: function (x, t, b, c, d) {return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b},
  391. easeOutBounce: function (x, t, b, c, d) {if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b;} else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;} else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;} else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;}},
  392. easeInOutBounce: function (x, t, b, c, d) {if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;}
  393. });