jquery.SuperSlide.2.1.js 20 KB

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