jquery.SuperSlide.2.1.3.source.js 21 KB

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