1/*! 2 * SuperSlide v2.0 3 * è½»æ¾è§£å³ç½ç«å¤§é¨åç¹æå±ç¤ºé®é¢ 4 * 详尽信æ¯è¯·çå®ç½ï¼http://www.SuperSlide2.com/ 5 * 6 * Copyright 2011-2013, 大è¯ä¸»å¸ 7 * 8 * 请å°éååï¼ä¿ç头é¨çæ 9 * å¨ä¿ççæçåæä¸å¯åºç¨äºä¸ªäººæåä¸ç¨é 10 */ 11 12(function($){ 13 var defaults={ 14 effect:"fade", 15 autoPlay:true, 16 delayTime:500, 17 interTime:5000, 18 triggerTime:150, 19 defaultIndex:0, 20 titCell:".hd li", 21 mainCell:".bd", 22 targetCell:null, 23 trigger:"mouseover", 24 scroll:1, 25 vis:1, 26 titOnClassName:"on", 27 autoPage:false, 28 prevCell:".prev", 29 nextCell:".next", 30 pageStateCell:".pageState", 31 opp: false, 32 pnLoop:true, 33 easing:"linear", 34 startFun:null, 35 endFun:null, 36 switchLoad:null, 37 imgfull:false 38 }; 39 $.fn.slideNew=function(options){ 40 if (this.length == 0) 41 return this; 42 43 // support mutltiple elements 44 if (this.length > 1) { 45 this.each(function () { 46 $(this).slideNew(options) 47 }); 48 return this; 49 } 50 var el = this; 51 52 return this.each(function() { 53 var opts = $.extend({},defaults,options); 54 var effect = opts.effect; 55 var prevBtn = $(opts.prevCell, $(this)); 56 var nextBtn = $(opts.nextCell, $(this)); 57 var pageState = $(opts.pageStateCell, $(this)); 58 var navObj = $(opts.titCell, $(this));//导èªåå ç´ ç»å 59 var navObjSize = navObj.length; 60 var conBox = $(opts.mainCell , $(this));//å 容å ç´ ç¶å±å¯¹è±¡ 61 var conBoxSize=conBox.children().length; 62 var sLoad=opts.switchLoad; 63 if(opts.targetCell!=null){ var tarObj = $(opts.targetCell, $(this)) }; 64 65 /*å符串转æ¢ä¸ºæ°å*/
66 var index=parseInt(opts.defaultIndex); 67 var delayTime=parseInt(opts.delayTime); 68 var interTime=parseInt(opts.interTime); 69 var triggerTime=parseInt(opts.triggerTime); 70 var scroll=parseInt(opts.scroll); 71 var vis=parseInt(opts.vis); 72 var autoPlay = (opts.autoPlay=="false"||opts.autoPlay==false)?false:true; 73 var opp = (opts.opp=="false"||opts.opp==false)?false:true; 74 var autoPage = (opts.autoPage=="false"||opts.autoPage==false)?false:true; 75 var loop = (opts.pnLoop=="false"||opts.pnLoop==false)?false:true; 76 var imgfull = (opts.imgfull=="false"||opts.imgfull==false)?false:true; 77 78 var slideH=0; 79 var slideW=0; 80 var selfW=0; 81 var selfH=2000; 82 var easing=opts.easing; 83 var inter=null;//setIntervalåç§° 84 var oldIndex = index; 85 var working=false; 86 var isScrolling; 87 88 //å¤çå页 89 if( navObjSize==0 )navObjSize=conBoxSize; 90 if( autoPage ){ 91 var tempS = conBoxSize-vis; 92 navObjSize=1+parseInt(tempS%scroll!=0?(tempS/scroll+1):(tempS/scroll)); 93 if(navObjSize<=0)navObjSize=1; 94 navObj.html(""); 95 for( var i=0; i<navObjSize; i++ ){ navObj.append("<li>"+(i+1)+"</li>") } 96 var navObj = $("li", navObj);//é置导èªåå ç´ å¯¹è±¡ 97 } 98 99 100 if(imgfull){ 101 switch(effect) 102 { 103 case "top": 104 case "topLoop": 105 case "topMarquee": 106 case "bottomLoop": 107 case "bottomMarquee":conBox.children().find('img').css({'width':'100%'}); break; 108 } 109 } 110 conBox.children().each(function(){ //åæå¤§å¼ 111 if( $(this).width()>selfW ){ selfW=$(this).outerWidth(); slideW=$(this).outerWidth(true);if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion .split(";")[1].replace(/[ ]/g,"")=="MSIE7.0"){selfW=$(this).width();}; } 112 if( $(this).height()<selfH ){ selfH=$(this).height(); slideH=$(this).outerHeight(true); } 113 }); 114 if(imgfull){ 115 oneImgW=conBox.find('img').eq(0).width(); 116 oneImgH=conBox.find('img').eq(0).height(); 117 imgHN = (oneImgH * selfW) / oneImgW; 118 switch(effect) 119 { 120 case "fold": 121 case "left": 122 case "leftLoop": 123 case "leftMarquee": 124 case "rightLoop": 125 case "rightMarquee":conBox.children().find('img').css({'width':'100%','height':imgHN}); break; 126 } 127 } 128 if(conBoxSize>=vis){ //å½å 容个æ°å°äºå¯è§ä¸ªæ°ï¼ä¸æ§è¡ææã 129 switch(effect) 130 { 131 case "fold": conBox.css({"position":"relative","width":slideW,"height":slideH}).children().css( {"position":"absolute","width":selfW,"left":0,"top":0,"display":"none"} ); break; 132 case "top": conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; height:'+vis*slideH+'px"></div>').css( { "position":"relative","padding":"0","margin":"0"}).children().css( {"height":selfH} ); break; 133 case "left": conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; width:'+vis*slideW+'px"></div>').css( { "width":conBoxSize*slideW,"position":"relative","overflow":"hidden","padding":"0","margin":"0"}).children().css( {"float":"left","width":selfW} ); break; 134 case "leftLoop": 135 case "leftMarquee": 136 conBox.children().clone().appendTo(conBox).clone().prependTo(conBox); 137 conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; width:'+vis*slideW+'px"></div>').css( { "width":conBoxSize*slideW*3+1,"position":"relative","overflow":"hidden","padding":"0","margin":"0","left":-conBoxSize*slideW}).children().css( {"float":"left","width":selfW} ); break; 138 case "rightLoop": 139 case "rightMarquee": 140 conBox.children().clone().appendTo(conBox).clone().prependTo(conBox); 141 conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; width:'+vis*slideW+'px"></div>').css( { "width":conBoxSize*slideW*3+1,"position":"relative","overflow":"hidden","padding":"0","margin":"0","left":-conBoxSize*slideW}).children().css( {"float":"left","width":selfW} ); break; 142 case "topLoop": 143 case "topMarquee": 144 conBox.children().clone().appendTo(conBox).clone().prependTo(conBox); 145 conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; height:'+vis*slideH+'px"></div>').css( { "height":conBoxSize*slideH*3,"position":"relative","padding":"0","margin":"0","top":-conBoxSize*slideH}).children().css( {"height":selfH} ); break; 146 case "bottomLoop": 147 case "bottomMarquee": 148 conBox.children().clone().appendTo(conBox).clone().prependTo(conBox); 149 conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; height:'+vis*slideH+'px"></div>').css( { "height":conBoxSize*slideH*3,"position":"relative","padding":"0","margin":"0","top":-conBoxSize*slideH}).children().css( {"height":selfH} ); break; 150 } 151 } 152 $(window).bind('resize', function(){ 153 resizeWindow(); 154 }); 155 var resizeWindow = function (e) { 156 if(effect!=='fade'){ 157 conBox.removeAttr('style'); 158 conBox.children().removeAttr('style'); 159 conBox.parent().removeAttr('style'); 160 } 161 slideH=0; 162 slideW=0; 163 selfW=0; 164 selfH=2000; 165 conBox.children().each(function(){ //åæå¤§å¼ 166 if( $(this).width()>selfW ){ selfW=$(this).outerWidth(); slideW=$(this).outerWidth(true);if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion .split(";")[1].replace(/[ ]/g,"")=="MSIE7.0"){selfW=$(this).width();}; } 167 if( $(this).height()<selfH ){ selfH=$(this).height(); slideH=$(this).outerHeight(true); } 168 }); 169 if(imgfull){ 170 imgHN=(oneImgH * selfW)/oneImgW; 171 switch(effect) 172 { 173 case "fold":
174 case "left": 175 case "leftLoop": 176 case "leftMarquee": 177 case "rightLoop": 178 case "rightMarquee":conBox.children().find('img').css({'width':'100%','height':imgHN});break; 179 } 180 } 181 if(conBoxSize>=vis){ //å½å 容个æ°å°äºå¯è§ä¸ªæ°ï¼ä¸æ§è¡ææã 182 switch(effect) 183 { 184 case "fold": conBox.css({"position":"relative","width":slideW,"height":slideH}).children().css( {"position":"absolute","width":selfW,"left":0,"top":0,"display":"none"} ); break; 185 case "top": conBox.parent().css({'overflow':'hidden', 'position':'relative', 'height': vis*slideH}); 186 conBox.css( { "position":"relative","padding":"0","margin":"0"}).children().css( {"height":selfH} ); break; 187 case "left": conBox.parent().css({'overflow':'hidden', 'position':'relative', 'width': vis*slideW}); 188 conBox.css( { "width":conBoxSize*slideW,"position":"relative","overflow":"hidden","padding":"0","margin":"0"}).children().css( {"float":"left","width":selfW} ); break; 189 case "leftLoop": 190 case "leftMarquee": 191 conBox.parent().css({'overflow':'hidden', 'position':'relative', 'width': vis*slideW}); 192 conBox.css( { "width":conBoxSize*slideW*3+1,"position":"relative","overflow":"hidden","padding":"0","margin":"0","left":-conBoxSize*slideW}).children().css( {"float":"left","width":selfW} ); break; 193 case "rightLoop": 194 case "rightMarquee": 195 conBox.parent().css({'overflow':'hidden', 'position':'relative', 'width': vis*slideW}); 196 conBox.css( { "width":conBoxSize*slideW*3+1,"position":"relative","overflow":"hidden","padding":"0","margin":"0","left":-conBoxSize*slideW}).children().css( {"float":"left","width":selfW} ); break; 197 case "topLoop": 198 case "topMarquee": 199 conBox.parent().css({'overflow':'hidden', 'position':'relative', 'height': vis*slideH}); 200 conBox.css( { "height":conBoxSize*slideH*3,"position":"relative","padding":"0","margin":"0","top":-conBoxSize*slideH}).children().css( {"height":selfH} ); break; 201 case "bottomLoop": 202 case "bottomMarquee": 203 conBox.parent().css({'overflow':'hidden', 'position':'relative', 'height': vis*slideH}); 204 conBox.css( { "height":conBoxSize*slideH*3,"position":"relative","padding":"0","margin":"0","top":-conBoxSize*slideH}).children().css( {"height":selfH} ); break; 205 } 206 } 207 doPlay(); 208 } 209 210 var doStartFun=function(){ if ( $.isFunction( opts.startFun) ){ opts.startFun( index,navObjSize ); } }; 211 var doEndFun=function(){ if ( $.isFunction( opts.endFun ) ){ opts.endFun( index,navObjSize ); } }; 212 var doSwitchLoad=function(objs){ 213 objs.eq(index).find("img").each(function(){ 214 if ( typeof($(this).attr(sLoad))!="undefined"){ $(this).attr("src",$(this).attr(sLoad)).removeAttr(sLoad) } 215 }) 216 } 217 218 //ææå½æ° 219 var doPlay=function(isFirst){ 220 if( oldIndex==index && !isFirst && effect!="leftMarquee" && effect!="topMarquee" && effect!="rightMarquee" && effect!="bottomMarquee" ) return; // å½åé¡µç¶æä¸è§¦åææ 221 switch(effect) 222 { 223 case "fade": case "fold": case "top": case "left": if ( index >= navObjSize) { index = 0; } else if( index < 0) { index = navObjSize-1; } break; 224 case "leftMarquee":case "topMarquee": if ( index>= 1) { index=1; } else if( index<=0) { index = 0; } break; 225 case "rightMarquee":case "bottomMarquee": if ( index>= 1) { index=1; } else if( index<=0) { index = 0; } break; 226 case "leftLoop": case "topLoop": 227 var tempNum = index - oldIndex; 228 if( navObjSize>2 && tempNum==-(navObjSize-1) ) tempNum=1; 229 if( navObjSize>2 && tempNum==(navObjSize-1) ) tempNum=-1; 230 var scrollNum = Math.abs( tempNum*scroll ); 231 if ( index >= navObjSize) { index = 0; } else if( index < 0) { index = navObjSize-1; } 232 case "rightLoop": case "bottomLoop": 233 var tempNum = index - oldIndex; 234 if( navObjSize>2 && tempNum==-(navObjSize-1) ) tempNum=1; 235 if( navObjSize>2 && tempNum==(navObjSize-1) ) tempNum=-1; 236 var scrollNum = Math.abs( tempNum*scroll ); 237 if ( index >= navObjSize) { index = 0; } else if( index < 0) { index = navObjSize-1; } 238 break; 239 } 240 241 doStartFun(); 242 243 //å¤ç忢å è½½ 244 if( sLoad!=null ){ doSwitchLoad( conBox.children() ) } 245 246 //å¤çtargetCell 247 if(tarObj){ 248 if( sLoad!=null ){ doSwitchLoad( tarObj ) } 249 tarObj.hide().eq(index).animate({opacity:"show"},delayTime,function(){ if(!conBox[0])doEndFun() }); 250 } 251 252 if(conBoxSize>=vis){ //å½å 容个æ°å°äºå¯è§ä¸ªæ°ï¼ä¸æ§è¡ææã 253 switch (effect) 254 { 255 case "fade":conBox.children().stop(true,true).eq(index).animate({opacity:"show"},delayTime,easing,function(){doEndFun()}).siblings().hide(); break; 256 case "fold":conBox.children().stop(true,true).eq(index).animate({opacity:"show"},delayTime,easing,function(){doEndFun()}).siblings().animate({opacity:"hide"},delayTime,easing);break;
257 case "top":conBox.stop(true,false).animate({"top":-index*scroll*slideH},delayTime,easing,function(){doEndFun()});break; 258 case "left":conBox.stop(true,false).animate({"left":-index*scroll*slideW},delayTime,easing,function(){doEndFun()});break; 259 case "leftLoop": 260 if(tempNum<0 ){ 261 conBox.stop(true,true).animate({"left":-(conBoxSize-scrollNum )*slideW},delayTime,easing,function(){ 262 for(var i=0;i<scrollNum;i++){ conBox.children().last().prependTo(conBox); } 263 conBox.css("left",-conBoxSize*slideW); 264 doEndFun(); 265 }); 266 } 267 else{ 268 conBox.stop(true,true).animate({"left":-( conBoxSize + scrollNum)*slideW},delayTime,easing,function(){ 269 for(var i=0;i<scrollNum;i++){ conBox.children().eq(0).appendTo(conBox); } 270 conBox.css("left",-conBoxSize*slideW); 271 doEndFun(); 272 }); 273 }break;// leftLoop end 274 case "rightLoop": 275 if(tempNum<0 ){ 276 conBox.stop(true,true).animate({"left":-(conBoxSize+scrollNum )*slideW},delayTime,easing,function(){ 277 for(var i=0;i<scrollNum;i++){ conBox.children().eq(0).appendTo(conBox); } 278 conBox.css("left",-conBoxSize*slideW); 279 doEndFun(); 280 });
281 } 282 else{ 283 conBox.stop(true,true).animate({"left":-( conBoxSize - scrollNum)*slideW},delayTime,easing,function(){ 284 for(var i=0;i<scrollNum;i++){ conBox.children().last().prependTo(conBox); } 285 conBox.css("left",-conBoxSize*slideW); 286 doEndFun(); 287 }); 288 }break;// rightLoop end 289 case "topLoop": 290 if(tempNum<0 ){ 291 conBox.stop(true,true).animate({"top":-(conBoxSize-scrollNum )*slideH},delayTime,easing,function(){ 292 for(var i=0;i<scrollNum;i++){ conBox.children().last().prependTo(conBox); } 293 conBox.css("top",-conBoxSize*slideH); 294 doEndFun(); 295 }); 296 } 297 else{ 298 conBox.stop(true,true).animate({"top":-( conBoxSize + scrollNum)*slideH},delayTime,easing,function(){ 299 for(var i=0;i<scrollNum;i++){ conBox.children().first().appendTo(conBox); } 300 conBox.css("top",-conBoxSize*slideH); 301 doEndFun(); 302 }); 303 }break;//topLoop end 304 case "bottomLoop": 305 if(tempNum<0 ){ 306 conBox.stop(true,true).animate({"top":-(conBoxSize+scrollNum )*slideH},delayTime,easing,function(){ 307 for(var i=0;i<scrollNum;i++){ conBox.children().first().appendTo(conBox); } 308 conBox.css("top",-conBoxSize*slideH); 309 doEndFun(); 310 });
311 } 312 else{ 313 conBox.stop(true,true).animate({"top":-( conBoxSize - scrollNum)*slideH},delayTime,easing,function(){ 314 for(var i=0;i<scrollNum;i++){ conBox.children().last().prependTo(conBox); } 315 conBox.css("top",-conBoxSize*slideH); 316 doEndFun(); 317 }); 318 }break;//bottomLoop end 319 320 case "leftMarquee": 321 var tempLeft = conBox.css("left").replace("px",""); 322 323 if(index==0 ){ 324 conBox.animate({"left":++tempLeft},0,function(){ 325 326 if( conBox.css("left").replace("px","")>= 0){ for(var i=0;i<conBoxSize;i++){ conBox.children().last().prependTo(conBox); }conBox.css("left",-conBoxSize*slideW);} 327 }); 328 } 329 else{ 330 conBox.animate({"left":--tempLeft},0,function(){ 331 if( conBox.css("left").replace("px","")<= -conBoxSize*slideW*2){ for(var i=0;i<conBoxSize;i++){ conBox.children().first().appendTo(conBox); }conBox.css("left",-conBoxSize*slideW);} 332 }); 333 }break;// leftMarquee end 334 case "rightMarquee": 335 var tempLeft = conBox.css("left").replace("px",""); 336 if(index==0 ){ 337 conBox.animate({"left":--tempLeft},0,function(){ 338 if( conBox.css("left").replace("px","")<= -conBoxSize*slideW*2){for(var i=0;i<conBoxSize;i++){conBox.children().first().appendTo(conBox); }conBox.css("left",-conBoxSize*slideW); } 339 }); 340 } 341 else{ 342 conBox.animate({"left":++tempLeft},0,function(){ 343 if( conBox.css("left").replace("px","")>= 0){ for(var i=0;i<conBoxSize;i++){ conBox.children().last().prependTo(conBox); }conBox.css("left",-conBoxSize*slideW);} 344 }); 345 }break;// rightMarquee end 346 347 case "topMarquee": 348 var tempTop = conBox.css("top").replace("px",""); 349 if(index==0 ){ 350 conBox.animate({"top":++tempTop},0,function(){ 351 if( conBox.css("top").replace("px","") >= 0){ for(var i=0;i<conBoxSize;i++){ conBox.children().last().prependTo(conBox); }conBox.css("top",-conBoxSize*slideH);} 352 }); 353 } 354 else{ 355 conBox.animate({"top":--tempTop},0,function(){ 356 if( conBox.css("top").replace("px","")<= -conBoxSize*slideH*2){ for(var i=0;i<conBoxSize;i++){ conBox.children().first().appendTo(conBox); }conBox.css("top",-conBoxSize*slideH);} 357 }); 358 }break;// topMarquee end 359 case "bottomMarquee": 360 var tempTop = conBox.css("top").replace("px",""); 361 if(index==0 ){ 362 conBox.animate({"top":--tempTop},0,function(){ 363 if( conBox.css("top").replace("px","")<= -conBoxSize*slideH*2){ for(var i=0;i<conBoxSize;i++){ conBox.children().last().prependTo(conBox); }conBox.css("top",-conBoxSize*slideH);} 364 }); 365 } 366 else{ 367 conBox.animate({"top":++tempTop},0,function(){ 368 if( conBox.css("top").replace("px","") >= 0){ for(var i=0;i<conBoxSize;i++){ conBox.children().first().appendTo(conBox); }conBox.css("top",-conBoxSize*slideH);} 369 }); 370 }break;// bottomMarquee end 371 372 373 }//switch end 374 } 375 navObj.removeClass(opts.titOnClassName).eq(index).addClass(opts.titOnClassName); 376 oldIndex=index; 377 if( loop==false ){ //loopæ§å¶æ¯å¦ç»§ç»å¾ªç¯ 378 nextBtn.removeClass("nextStop"); prevBtn.removeClass("prevStop"); 379 if (index==0 ){ prevBtn.addClass("prevStop"); } 380 else if (index==navObjSize-1 ){ nextBtn.addClass("nextStop"); } 381 } 382 }; 383 var add_point=function(){ 384 var pages=''; 385 for(var i=0; i<navObjSize; i++){ 386 if(i===index){ 387 pages +='<span class="active" ></span>'; 388 }else{ 389 pages += '<span></span>'; 390 } 391 } 392 pageState.html(pages); 393 } 394 //åå§åæ§è¡ 395 doPlay(true); 396 //æ·»å æé® 397 add_point(true); 398 var add_active=function(){ 399 var pagest=pageState.children('span'); 400 pagest.eq(index).siblings('span').removeClass('active'); 401 pagest.eq(index).addClass('active'); 402 403 } 404 //èªå¨ææ¾ 405 if (autoPlay) { 406 if( effect=="leftMarquee" || effect=="topMarquee" || effect=="rightMarquee" || effect=="bottomMarquee" ){ 407 if(opp){ index-- }else{ index++ } inter = setInterval(function(){doPlay(),add_active()}, interTime); 408 conBox.hover(function(){if(autoPlay){clearInterval(inter); }},function(){if(autoPlay){clearInterval(inter);inter = setInterval(function(){doPlay(),add_active()}, interTime);}}); 409 }else{ 410 inter=setInterval(function(){ if(opp){ index-- }else{ index++ } ; doPlay(),add_active() }, interTime); 411 $(this).hover(function(){if(autoPlay){clearInterval(inter); }},function(){if(autoPlay){clearInterval(inter); inter=setInterval(function(){if(opp){ index-- }else{ index++ }; doPlay(),add_active() }, interTime); }}); 412 } 413 } 414 415 //é¼ æ äºä»¶ 416 var mst; 417 if(opts.trigger=="mouseover"){ 418 navObj.hover(function(){ index=navObj.index(this); mst = window.setTimeout(doPlay,opts.triggerTime); }, function(){ clearTimeout(mst); }); 419 }else{ navObj.click(function(){index=navObj.index(this); doPlay();add_active(); }) } 420 var goToNextSlide=function() { if ( loop==true || index!=navObjSize-1 ){ index++; doPlay();add_active();} } 421 var goToPrevSlide=function() { if ( loop==true || index!=0 ){ index--; doPlay();add_active(); }} 422 nextBtn.click(function(){ if ( loop==true || index!=navObjSize-1 ){ index++; doPlay();add_active(); } }); 423 prevBtn.click(function(){ if ( loop==true || index!=0 ){ index--; doPlay();add_active(); } }); 424 var alist=pageState.children('span'); 425 alist.each(function(){ 426 $(this).on("click",function(){ 427 var i=alist.index($(this)); 428 if ( loop==true || index!=i ){ index=i; doPlay();add_active(); } 429 }); 430 });
431 /** 432 * Initializes touch events 433 */ 434 var istouch=false; 435 var xMovement,yMovement; 436 var isTouchDevice = function() { 437 try { 438 document.createEvent("TouchEvent"); 439 istouch=true; 440 441 } catch (e) { 442 istouch=false; 443 } 444 } 445 var initTouch = function () { 446 // initialize object to contain all touch values 447 el.touch = { 448 start: {x: 0, y: 0}, 449 end: {x: 0, y: 0} 450 } 451 el.bind('touchstart', onTouchStart); 452 } 453 isTouchDevice(); 454 /** 455 * Event handler for "touchstart" 456 * 457 * @param e (event) 458 * - DOM event object 459 */ 460 var onTouchStart = function (e) { 461 // record the original position when touch starts 462 el.touch.originalPos = el.position(); 463 isScrolling = 0; 464 var orig = e.originalEvent; 465 // record the starting touch x, y coordinates 466 el.touch.start.x = orig.changedTouches[0].pageX; 467 el.touch.start.y = orig.changedTouches[0].pageY; 468 // bind a "touchmove" event to the viewport 469 el.bind('touchmove', onTouchMove); 470 // bind a "touchend" event to the viewport 471 el.bind('touchend', onTouchEnd); 472 } 473 474 /** 475 * Event handler for "touchmove" 476 * 477 * @param e (event) 478 * - DOM event object 479 */ 480 var onTouchMove = function (e) { 481 if(event.targetTouches.length > 1 || e.scale && e.scale !== 1) return; 482 var orig = e.originalEvent; 483 el.touch.end.x = orig.changedTouches[0].pageX; 484 el.touch.end.y = orig.changedTouches[0].pageY; 485 // if scrolling on y axis, do not prevent default 486 xMovement = Math.abs(el.touch.end.x - el.touch.start.x); 487 yMovement = Math.abs(el.touch.end.y - el.touch.start.y); 488 isScrolling = xMovement < yMovement ? 1:0; 489 if(isScrolling === 0){ 490ããã ãe.preventDefault(); 491 } 492 } 493 494 /** 495 * Event handler for "touchend" 496 * 497 * @param e (event) 498 * - DOM event object 499 */ 500 var onTouchEnd = function (e) { 501 if(isScrolling === 0){ 502 if(xMovement >20){ 503 switch(effect) 504 { 505 case "fade": 506 case "fold": 507 case "left": 508 case "leftLoop": 509 case "leftMarquee":el.touch.start.x > el.touch.end.x ? goToNextSlide() : goToPrevSlide();break; 510 case "rightLoop": 511 case "rightMarquee":el.touch.start.x > el.touch.end.x ? goToPrevSlide() : goToNextSlide();break; 512 } 513 } 514 } 515 el.unbind('touchmove', onTouchMove); 516 el.unbind('touchend', onTouchEnd); 517 } 518 initTouch(); 519 });//each End 520 521 };//slide End 522 523})(jQuery); 524 525jQuery.easing['jswing'] = jQuery.easing['swing']; 526jQuery.extend( jQuery.easing, 527{ 528 def: 'easeOutQuad', 529 swing: function (x, t, b, c, d) { return jQuery.easing[jQuery.easing.def](x, t, b, c, d); }, 530 easeInQuad: function (x, t, b, c, d) {return c*(t/=d)*t + b;}, 531 easeOutQuad: function (x, t, b, c, d) {return -c *(t/=d)*(t-2) + b}, 532 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}, 533 easeInCubic: function (x, t, b, c, d) {return c*(t/=d)*t*t + b}, 534 easeOutCubic: function (x, t, b, c, d) {return c*((t=t/d-1)*t*t + 1) + b}, 535 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}, 536 easeInQuart: function (x, t, b, c, d) {return c*(t/=d)*t*t*t + b}, 537 easeOutQuart: function (x, t, b, c, d) {return -c * ((t=t/d-1)*t*t*t - 1) + b}, 538 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}, 539 easeInQuint: function (x, t, b, c, d) {return c*(t/=d)*t*t*t*t + b}, 540 easeOutQuint: function (x, t, b, c, d) {return c*((t=t/d-1)*t*t*t*t + 1) + b}, 541 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}, 542 easeInSine: function (x, t, b, c, d) {return -c * Math.cos(t/d * (Math.PI/2)) + c + b}, 543 easeOutSine: function (x, t, b, c, d) {return c * Math.sin(t/d * (Math.PI/2)) + b},
vendor: 2,873 bytes, lines 544-565
544 easeInOutSine: function (x, t, b, c, d) {return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b}, 545 easeInExpo: function (x, t, b, c, d) {return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b}, 546 easeOutExpo: function (x, t, b, c, d) {return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b}, 547 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}, 548 easeInCirc: function (x, t, b, c, d) {return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b}, 549 easeOutCirc: function (x, t, b, c, d) {return c * Math.sqrt(1 - (t=t/d-1)*t) + b}, 550 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}, 551 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; } 552 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}, 553 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; } 554 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}, 555 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; } 556 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}, 557 easeInBack: function (x, t, b, c, d, s) {if (s == undefined) s = 1.70158;return c*(t/=d)*t*((s+1)*t - s) + b}, 558 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}, 559 easeInOutBack: function (x, t, b, c, d, s) {if (s == undefined) s = 1.70158; 560 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}, 561 easeInBounce: function (x, t, b, c, d) {return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b}, 562 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;}}, 563 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;} 564}); 565
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.