https://thevalencialofts.com/wp-content/themes/ananke/js/jquery.malihu.PageScroll2id.js?ver=20160621
vendor: 16,305 bytes, lines 1-502
1/* 2== Page scroll to id == 3Version: 1.5.2 4Plugin URI: http://manos.malihu.gr/page-scroll-to-id/ 5Author: malihu 6Author URI: http://manos.malihu.gr 7License: MIT License (MIT) 8*/ 9 10/* 11Copyright 2013 malihu (email: [email protected]) 12 13Permission is hereby granted, free of charge, to any person obtaining a copy 14of this software and associated documentation files (the "Software"), to deal 15in the Software without restriction, including without limitation the rights 16to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17copies of the Software, and to permit persons to whom the Software is 18furnished to do so, subject to the following conditions: 19 20The above copyright notice and this permission notice shall be included in 21all copies or substantial portions of the Software. 22 23THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29THE SOFTWARE. 30*/ 31 32;(function($,window,document,undefined){ 33 34 /* plugin namespace, prefix, default selector(s) */ 35 36 var pluginNS="mPageScroll2id", 37 pluginPfx="mPS2id", 38 defaultSelector=".m_PageScroll2id,a[rel~='m_PageScroll2id'],.page-scroll-to-id,a[rel~='page-scroll-to-id']", 39 40 /* default options */ 41 42 defaults={ 43 /* scroll animation speed in milliseconds: Integer */ 44 scrollSpeed:1300, 45 /* auto-adjust animation speed (according to target element position and window scroll): Boolean */ 46 autoScrollSpeed:true, 47 /* scroll animation easing when page is idle: String */ 48 scrollEasing:"easeInOutExpo", 49 /* scroll animation easing while page is scrolling: String */ 50 scrollingEasing:"easeInOutCirc", 51 /* end of page "smooth scrolling" (auto-adjust the scroll-to position when bottom elements are too short): Boolean */ 52 pageEndSmoothScroll:true, 53 /* 54 page layout defines scrolling direction: String 55 values: "vertical", "horizontal", "auto" 56 */ 57 layout:"vertical", 58 /* extra space in pixels for the target element position: Integer */ 59 offset:0, 60 /* highlight the main/default selectors or insert a different set: Boolean, String */ 61 highlightSelector:false, 62 /* class of the clicked element: String */ 63 clickedClass:pluginPfx+"-clicked", 64 /* class of the current target element: String */ 65 targetClass:pluginPfx+"-target", 66 /* class of the highlighted element: String */ 67 highlightClass:pluginPfx+"-highlight", 68 /* force a single highlighted element each time: Boolean */ 69 forceSingleHighlight:false, 70 /* keep element highlighted until next (one element always stays highlighted): boolean */ 71 keepHighlightUntilNext:false, 72 /* disable plugin below [x,y] screen size: boolean, integer, array ([x,y]) */ 73 disablePluginBelow:false, 74 /* enable/disable click events for all selectors */ 75 clickEvents:true, 76 /* user callback functions: fn */ 77 onStart:function(){}, 78 onComplete:function(){}, 79 /* enable/disable the default selector: Boolean */ 80 defaultSelector:false 81 }, 82 83 /* vars, constants */ 84 85 selector,opt,_init,_trigger,_clicked,_target,_to,_axis,_offset,_dataOffset, 86 87 /* 88 --------------- 89 methods 90 --------------- 91 */ 92 93 methods={ 94 95 /* plugin initialization method */ 96 97 init:function(options){ 98 99 /* extend options, store each option in jquery data */ 100 101 var options=$.extend(true,{},defaults,options); 102 103 $(document).data(pluginPfx,options); 104 opt=$(document).data(pluginPfx); 105 106 /* set default selector */ 107 108 selector=(!selector) ? this.selector : selector+","+this.selector; 109 110 if(opt.defaultSelector){ 111 if(typeof $(selector)!=="object" || $(selector).length===0){ 112 selector=defaultSelector; 113 } 114 } 115 116 /* plugin events */ 117 118 if(opt.clickEvents){ 119 $(document) 120 121 .undelegate("."+pluginPfx) 122 123 .delegate(selector,"click."+pluginPfx,function(e){ 124 if(functions._isDisabled.call(null)){ 125 functions._removeClasses.call(null); 126 return; 127 } 128 var $this=$(this), 129 href=$this.attr("href"), 130 hrefProp=$this.prop("href"); 131 if(href && href.indexOf("#/")!==-1){ 132 return; 133 } 134 functions._reset.call(null); 135 _dataOffset=$this.data("ps2id-offset") || 0; 136 if(functions._isValid.call(null,href,hrefProp) && functions._findTarget.call(null,href)){ 137 e.preventDefault(); 138 _trigger="selector"; 139 _clicked=$this; 140 functions._setClasses.call(null,true); 141 functions._scrollTo.call(null); 142 } 143 }); 144 } 145 146 $(window) 147 148 .unbind("."+pluginPfx) 149 150 .bind("scroll."+pluginPfx+" resize."+pluginPfx,function(){ 151 if(functions._isDisabled.call(null)){ 152 functions._removeClasses.call(null); 153 return; 154 } 155 var targets=$("._"+pluginPfx+"-t"); 156 targets.each(function(i){ 157 var t=$(this),id=t.attr("id"), 158 h=functions._findHighlight.call(null,id); 159 functions._setClasses.call(null,false,t,h); 160 if(i==targets.length-1){functions._extendClasses.call(null);} 161 }); 162 }); 163 164 /* plugin has initialized */ 165 166 _init=true; 167 168 /* setup selectors, target elements, basic plugin classes etc. */ 169 170 functions._setup.call(null); 171 }, 172 173 /* scrollTo method */ 174 175 scrollTo:function(id,options){ 176 if(functions._isDisabled.call(null)){ 177 functions._removeClasses.call(null); 178 return; 179 } 180 if(id && typeof id!=="undefined"){ 181 functions._isInit.call(null); 182 var defaults={ 183 layout:opt.layout, 184 offset:opt.offset, 185 clicked:false 186 }, 187 options=$.extend(true,{},defaults,options); 188 functions._reset.call(null); 189 _axis=options.layout; 190 _offset=options.offset; 191 id=(id.indexOf("#")!==-1) ? id : "#"+id; 192 if(functions._isValid.call(null,id) && functions._findTarget.call(null,id)){ 193 _trigger="scrollTo"; 194 _clicked=options.clicked; 195 if(_clicked){ 196 functions._setClasses.call(null,true); 197 } 198 functions._scrollTo.call(null); 199 } 200 } 201 }, 202 203 /* destroy method */ 204 205 destroy:function(){ 206 $(window).unbind("."+pluginPfx); 207 $(document).undelegate("."+pluginPfx).removeData(pluginPfx); 208 $("._"+pluginPfx+"-t").removeData(pluginPfx); 209 functions._removeClasses.call(null,true); 210 } 211 }, 212 213 /* 214 --------------- 215 functions 216 --------------- 217 */ 218 219 functions={ 220 221 /* checks if screen size ([x,y]) is below the value(s) set in disablePluginBelow option */ 222 223 _isDisabled:function(){ 224 var e=window,a="inner", 225 val=opt.disablePluginBelow instanceof Array ? [opt.disablePluginBelow[0] || 0,opt.disablePluginBelow[1] || 0] : [opt.disablePluginBelow || 0,0]; 226 if(!("innerWidth" in window )){ 227 a="client"; 228 e=document.documentElement || document.body; 229 } 230 return e[a+"Width"]<=val[0] || e[a+"Height"]<=val[1]; 231 }, 232 233 /* checks if href attribute is valid */ 234 235 _isValid:function(href,hrefProp){ 236 if(!href){ 237 return; 238 } 239 hrefProp=(!hrefProp) ? href : hrefProp; 240 var str=(hrefProp.indexOf("#/")!==-1) ? hrefProp.split("#/")[0] : hrefProp.split("#")[0], 241 loc=window.location.toString().split("#")[0]; 242 return href!=="#" && href.indexOf("#")!==-1 && (str==="" || str===loc); 243 }, 244 245 /* setup selectors, target elements, basic plugin classes etc. */ 246 247 _setup:function(){ 248 var el=(opt.highlightSelector && opt.highlightSelector!=="") ? opt.highlightSelector : selector,i=1; 249 return $(el).each(function(){ 250 var $this=$(this),href=$this.attr("href"),hrefProp=$this.prop("href"); 251 if(functions._isValid.call(null,href,hrefProp)){ 252 var id=(href.indexOf("#/")!==-1) ? href.split("#/")[1] : href.split("#")[1],t=$("#"+id); 253 if(t.length>0){ 254 if(!t.hasClass("_"+pluginPfx+"-t")){ 255 t.addClass("_"+pluginPfx+"-t").data(pluginPfx,{i:i}); 256 } 257 if(!$this.hasClass("_"+pluginPfx+"-h")){ 258 $this.addClass("_"+pluginPfx+"-h"); 259 } 260 var h=functions._findHighlight.call(null,id); 261 functions._setClasses.call(null,false,t,h); 262 i++ 263 if(i==$(el).length){functions._extendClasses.call(null);} 264 } 265 } 266 }); 267 }, 268 269 /* finds the target element */ 270 271 _findTarget:function(str){ 272 var val=(str.indexOf("#/")!==-1) ? str.split("#/")[1] : str.split("#")[1], 273 el=$("#"+val); 274 if(el.length<1 || el.css("position")==="fixed"){ 275 if(val==="top"){ 276 el=$("body"); 277 }else{ 278 return; 279 } 280 } 281 _target=el; 282 if(!_axis){ 283 _axis=opt.layout; 284 } 285 _offset=functions._setOffset.call(null); 286 _to=[(el.offset().top-_offset[0]).toString(),(el.offset().left-_offset[1]).toString()]; 287 _to[0]=(_to[0]<0) ? 0 : _to[0]; 288 _to[1]=(_to[1]<0) ? 0 : _to[1]; 289 return _to; 290 }, 291 292 /* sets the offset value (pixels, objects etc.) */ 293 294 _setOffset:function(){ 295 if(!_offset){ 296 _offset=(opt.offset) ? opt.offset : 0; 297 } 298 if(_dataOffset){ 299 _offset=_dataOffset; 300 } 301 var val,obj,y,x; 302 switch(typeof _offset){ 303 case "object": 304 case "string": 305 val=[(_offset["y"]) ? _offset["y"] : _offset,(_offset["x"]) ? _offset["x"] : _offset]; 306 obj=[(val[0] instanceof jQuery) ? val[0] : $(val[0]),(val[1] instanceof jQuery) ? val[1] : $(val[1])]; 307 if(obj[0].length>0){ // js/jquery object 308 y=obj[0].height(); 309 if(obj[0].css("position")==="fixed"){ // include position for fixed elements 310 y+=obj[0][0].offsetTop; 311 } 312 }else if(!isNaN(parseFloat(val[0])) && isFinite(val[0])){ // numeric string 313 y=parseInt(val[0]); 314 }else{ 315 y=0; // non-existing value 316 } 317 if(obj[1].length>0){ // js/jquery object 318 x=obj[1].width(); 319 if(obj[1].css("position")==="fixed"){ // include position for fixed elements 320 x+=obj[1][0].offsetLeft; 321 } 322 }else if(!isNaN(parseFloat(val[1])) && isFinite(val[1])){ // numeric string 323 x=parseInt(val[1]); 324 }else{ 325 x=0; // non-existing value 326 } 327 break; 328 case "function": 329 val=_offset.call(null); // function (single value or array) 330 if(val instanceof Array){ 331 y=val[0]; 332 x=val[1]; 333 }else{ 334 y=x=val; 335 } 336 break; 337 default: 338 y=x=parseInt(_offset); // number 339 } 340 return [y,x]; 341 }, 342 343 /* finds the element that should be highlighted */ 344 345 _findHighlight:function(id){ 346 var loc=window.location.toString().split("#")[0], 347 hHash=$("._"+pluginPfx+"-h[href='#"+id+"']"), 348 lhHash=$("._"+pluginPfx+"-h[href='"+loc+"#"+id+"']"), 349 hHashSlash=$("._"+pluginPfx+"-h[href='#/"+id+"']"), 350 lhHashSlash=$("._"+pluginPfx+"-h[href='"+loc+"#/"+id+"']"); 351 hHash=(hHash.length>0) ? hHash : lhHash; 352 hHashSlash=(hHashSlash.length>0) ? hHashSlash : lhHashSlash; 353 return (hHashSlash.length>0) ? hHashSlash : hHash; 354 }, 355 356 /* sets plugin classes */ 357 358 _setClasses:function(c,t,h){ 359 var cc=opt.clickedClass,tc=opt.targetClass,hc=opt.highlightClass; 360 if(c && cc && cc!==""){ 361 $("."+cc).removeClass(cc); 362 _clicked.addClass(cc); 363 }else if(t && tc && tc!=="" && h && hc && hc!==""){ 364 if(functions._currentTarget.call(null,t)){ 365 t.addClass(tc); 366 h.addClass(hc); 367 }else{ 368 if(!opt.keepHighlightUntilNext || $("."+hc).length>1){ 369 t.removeClass(tc); 370 h.removeClass(hc); 371 } 372 } 373 } 374 }, 375 376 /* extends plugin classes */ 377 378 _extendClasses:function(){ 379 var tc=opt.targetClass,hc=opt.highlightClass, 380 $tc=$("."+tc),$hc=$("."+hc),ftc=tc+"-first",ltc=tc+"-last",fhc=hc+"-first",lhc=hc+"-last"; 381 $("._"+pluginPfx+"-t").removeClass(ftc+" "+ltc); 382 $("._"+pluginPfx+"-h").removeClass(fhc+" "+lhc); 383 if(!opt.forceSingleHighlight){ 384 $tc.slice(0,1).addClass(ftc).end().slice(-1).addClass(ltc); 385 $hc.slice(0,1).addClass(fhc).end().slice(-1).addClass(lhc); 386 }else{ 387 if(opt.keepHighlightUntilNext && $tc.length>1){ 388 $tc.slice(0,1).removeClass(tc); $hc.slice(0,1).removeClass(hc); 389 }else{ 390 $tc.slice(1).removeClass(tc); $hc.slice(1).removeClass(hc); 391 } 392 } 393 }, 394 395 /* removes plugin classes */ 396 397 _removeClasses:function(destroy){ 398 $("."+opt.clickedClass).removeClass(opt.clickedClass); 399 $("."+opt.targetClass).removeClass(opt.targetClass+" "+opt.targetClass+"-first "+opt.targetClass+"-last"); 400 $("."+opt.highlightClass).removeClass(opt.highlightClass+" "+opt.highlightClass+"-first "+opt.highlightClass+"-last"); 401 if(destroy){ 402 $("._"+pluginPfx+"-t").removeClass("_"+pluginPfx+"-t"); 403 $("._"+pluginPfx+"-h").removeClass("_"+pluginPfx+"-h"); 404 } 405 }, 406 407 /* checks if target element is in viewport */ 408 409 _currentTarget:function(t){ 410 var o=opt["target_"+t.data(pluginPfx).i], 411 rect=t[0].getBoundingClientRect(); 412 if(typeof o!=="undefined"){ 413 var y=t.offset().top,x=t.offset().left, 414 from=(o.from) ? o.from+y : y,to=(o.to) ? o.to+y : y, 415 fromX=(o.fromX) ? o.fromX+x : x,toX=(o.toX) ? o.toX+x : x; 416 return( 417 rect.top >= to && rect.top <= from && 418 rect.left >= toX && rect.left <= fromX 419 ); 420 }else{ 421 var wh=$(window).height(),ww=$(window).width(), 422 th=t.height(),tw=t.width(), 423 base=1+(th/wh), 424 top=base,bottom=(th<wh) ? base*(wh/th) : base, 425 baseX=1+(tw/ww), 426 left=baseX,right=(tw<ww) ? baseX*(ww/tw) : baseX; 427 return( 428 rect.top <= wh/top && rect.bottom >= wh/bottom && 429 rect.left <= ww/left && rect.right >= ww/right 430 ); 431 } 432 }, 433 434 /* scrolls the page */ 435 436 _scrollTo:function(){ 437 opt.scrollSpeed=parseInt(opt.scrollSpeed); 438 _to=(opt.pageEndSmoothScroll) ? functions._pageEndSmoothScroll.call(null) : _to; 439 var el=$("html,body"), 440 speed=(opt.autoScrollSpeed) ? functions._autoScrollSpeed.call(null) : opt.scrollSpeed, 441 easing=(el.is(":animated")) ? opt.scrollingEasing : opt.scrollEasing, 442 _t=$(window).scrollTop(),_l=$(window).scrollLeft(); 443 switch(_axis){ 444 case "horizontal": 445 if(_l!=_to[1]){ 446 functions._callbacks.call(null,"onStart"); 447 el.stop().animate({scrollLeft:_to[1]},speed,easing).promise().then(function(){ 448 functions._callbacks.call(null,"onComplete"); 449 }); 450 } 451 break; 452 case "auto": 453 if(_t!=_to[0] || _l!=_to[1]){ 454 functions._callbacks.call(null,"onStart"); 455 if(navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/)){ // mobile fix 456 var left; 457 el.stop().animate({pageYOffset:_to[0],pageXOffset:_to[1]},{ 458 duration:speed, 459 easing:easing, 460 step:function(now,fx){ 461 if(fx.prop=='pageXOffset'){ 462 left=now; 463 }else if(fx.prop=='pageYOffset'){ 464 window.scrollTo(left,now); 465 } 466 } 467 }).promise().then(function(){ 468 functions._callbacks.call(null,"onComplete"); 469 }); 470 }else{ 471 el.stop().animate({scrollTop:_to[0],scrollLeft:_to[1]},speed,easing).promise().then(function(){ 472 functions._callbacks.call(null,"onComplete"); 473 }); 474 } 475 } 476 break; 477 default: 478 if(_t!=_to[0]){ 479 functions._callbacks.call(null,"onStart"); 480 el.stop().animate({scrollTop:_to[0]},speed,easing).promise().then(function(){ 481 functions._callbacks.call(null,"onComplete"); 482 }); 483 } 484 } 485 }, 486 487 /* sets end of page "smooth scrolling" position */ 488 489 _pageEndSmoothScroll:function(){ 490 var _dh=$(document).height(),_dw=$(document).width(), 491 _wh=$(window).height(),_ww=$(window).width(); 492 return [((_dh-_to[0])<_wh) ? _dh-_wh : _to[0],((_dw-_to[1])<_ww) ? _dw-_ww : _to[1]]; 493 }, 494 495 /* sets the auto-adjusted animation speed */ 496 497 _autoScrollSpeed:function(){ 498 var _t=$(window).scrollTop(),_l=$(window).scrollLeft(), 499 _h=$(document).height(),_w=$(document).width(), 500 val=[ 501 opt.scrollSpeed+((opt.scrollSpeed*(Math.floor((Math.abs(_to[0]-_t)/_h)*100)))/100), 502 opt.scrollSpeed+((opt.scrollSpeed*(Math.floor((Math.abs(_to[1]-_l)/_w
vendor: 6,660 bytes, lines 502-677
502)*100)))/100) 503 ]; 504 return Math.max.apply(Math,val); 505 }, 506 507 /* user callback functions */ 508 509 _callbacks:function(c){ 510 if(!opt){ 511 return; 512 } 513 this[pluginPfx]={ 514 trigger:_trigger,clicked:_clicked,target:_target,scrollTo:{y:_to[0],x:_to[1]} 515 }; 516 switch(c){ 517 case "onStart": 518 opt.onStart.call(null,this[pluginPfx]); 519 break; 520 case "onComplete": 521 opt.onComplete.call(null,this[pluginPfx]); 522 break; 523 } 524 }, 525 526 /* resets/clears vars and constants */ 527 528 _reset:function(){ 529 _axis=_offset=_dataOffset=false; 530 }, 531 532 /* checks if plugin has initialized */ 533 534 _isInit:function(){ 535 if(!_init){ 536 methods.init.apply(this); 537 } 538 }, 539 540 /* extends jquery with custom easings (as jquery ui) */ 541 542 _easing:function(){ 543 $.easing.easeInQuad=$.easing.easeInQuad || 544 function(x,t,b,c,d){return c*(t/=d)*t + b;}; 545 $.easing.easeOutQuad=$.easing.easeOutQuad || 546 function(x,t,b,c,d){return -c *(t/=d)*(t-2) + b;}; 547 $.easing.easeInOutQuad=$.easing.easeInOutQuad || 548 function(x,t,b,c,d){ 549 if ((t/=d/2) < 1) return c/2*t*t + b; 550 return -c/2 * ((--t)*(t-2) - 1) + b; 551 }; 552 $.easing.easeInCubic=$.easing.easeInCubic || 553 function(x,t,b,c,d){return c*(t/=d)*t*t + b;}; 554 $.easing.easeOutCubic=$.easing.easeOutCubic || 555 function(x,t,b,c,d){return c*((t=t/d-1)*t*t + 1) + b;}; 556 $.easing.easeInOutCubic=$.easing.easeInOutCubic || 557 function(x,t,b,c,d){ 558 if ((t/=d/2) < 1) return c/2*t*t*t + b; 559 return c/2*((t-=2)*t*t + 2) + b; 560 }; 561 $.easing.easeInQuart=$.easing.easeInQuart || 562 function(x,t,b,c,d){return c*(t/=d)*t*t*t + b;}; 563 $.easing.easeOutQuart=$.easing.easeOutQuart || 564 function(x,t,b,c,d){return -c * ((t=t/d-1)*t*t*t - 1) + b;}; 565 $.easing.easeInOutQuart=$.easing.easeInOutQuart || 566 function(x,t,b,c,d){ 567 if ((t/=d/2) < 1) return c/2*t*t*t*t + b; 568 return -c/2 * ((t-=2)*t*t*t - 2) + b; 569 }; 570 $.easing.easeInQuint=$.easing.easeInQuint || 571 function(x,t,b,c,d){return c*(t/=d)*t*t*t*t + b;}; 572 $.easing.easeOutQuint=$.easing.easeOutQuint || 573 function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t + 1) + b;}; 574 $.easing.easeInOutQuint=$.easing.easeInOutQuint || 575 function(x,t,b,c,d){ 576 if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; 577 return c/2*((t-=2)*t*t*t*t + 2) + b; 578 }; 579 $.easing.easeInExpo=$.easing.easeInExpo || 580 function(x,t,b,c,d){return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;}; 581 $.easing.easeOutExpo=$.easing.easeOutExpo || 582 function(x,t,b,c,d){return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;}; 583 $.easing.easeInOutExpo=$.easing.easeInOutExpo || 584 function(x,t,b,c,d){ 585 if (t==0) return b; 586 if (t==d) return b+c; 587 if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; 588 return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; 589 }; 590 $.easing.easeInSine=$.easing.easeInSine || 591 function(x,t,b,c,d){return -c * Math.cos(t/d * (Math.PI/2)) + c + b;}; 592 $.easing.easeOutSine=$.easing.easeOutSine || 593 function(x,t,b,c,d){return c * Math.sin(t/d * (Math.PI/2)) + b;}; 594 $.easing.easeInOutSine=$.easing.easeInOutSine || 595 function(x,t,b,c,d){return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;}; 596 $.easing.easeInCirc=$.easing.easeInCirc || 597 function(x,t,b,c,d){return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;}; 598 $.easing.easeOutCirc=$.easing.easeOutCirc || 599 function(x,t,b,c,d){return c * Math.sqrt(1 - (t=t/d-1)*t) + b;}; 600 $.easing.easeInOutCirc=$.easing.easeInOutCirc || 601 function(x,t,b,c,d){ 602 if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; 603 return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; 604 }; 605 $.easing.easeInElastic=$.easing.easeInElastic || 606 function(x,t,b,c,d){ 607 var s=1.70158;var p=0;var a=c; 608 if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 609 if (a < Math.abs(c)) { a=c; var s=p/4; } 610 else var s = p/(2*Math.PI) * Math.asin (c/a); 611 return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 612 }; 613 $.easing.easeOutElastic=$.easing.easeOutElastic || 614 function(x,t,b,c,d){ 615 var s=1.70158;var p=0;var a=c; 616 if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 617 if (a < Math.abs(c)) { a=c; var s=p/4; } 618 else var s = p/(2*Math.PI) * Math.asin (c/a); 619 return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; 620 }; 621 $.easing.easeInOutElastic=$.easing.easeInOutElastic || 622 function(x,t,b,c,d){ 623 var s=1.70158;var p=0;var a=c; 624 if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); 625 if (a < Math.abs(c)) { a=c; var s=p/4; } 626 else var s = p/(2*Math.PI) * Math.asin (c/a); 627 if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 628 return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; 629 }; 630 $.easing.easeInBack=$.easing.easeInBack || 631 function(x,t,b,c,d,s){ 632 if (s == undefined) s = 1.70158; 633 return c*(t/=d)*t*((s+1)*t - s) + b; 634 }; 635 $.easing.easeOutBack=$.easing.easeOutBack || 636 function(x,t,b,c,d,s){ 637 if (s == undefined) s = 1.70158; 638 return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; 639 }; 640 $.easing.easeInOutBack=$.easing.easeInOutBack || 641 function(x,t,b,c,d,s){ 642 if (s == undefined) s = 1.70158; 643 if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 644 return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 645 }; 646 $.easing.easeInBounce=$.easing.easeInBounce || 647 function(x,t,b,c,d){return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b;}; 648 $.easing.easeOutBounce=$.easing.easeOutBounce || 649 function(x,t,b,c,d){ 650 if ((t/=d) < (1/2.75)) {return c*(7.5625*t*t) + b;} 651 else if (t < (2/2.75)) {return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;} 652 else if (t < (2.5/2.75)) {return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;} 653 else {return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;} 654 }; 655 $.easing.easeInOutBounce=$.easing.easeInOutBounce || 656 function(x,t,b,c,d){ 657 if (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; 658 return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; 659 }; 660 } 661 } 662 663 /* 664 --------------- 665 plugin setup 666 --------------- 667 */ 668 669 /* extend jquery with custom easings */ 670 671 functions._easing.call(); 672 673 /* plugin constructor functions */ 674 675 $.fn[pluginNS]=function(method){ 676 if(methods[method]){ 677 return methods[method].apply(this,Array.prototype.slice.call(arguments,1
677)); 678 }else if(typeof method==="object" || !method){ 679 return methods.init.apply(this,arguments); 680 }else{ 681 $.error("Method "+method+" does not exist"); 682 } 683 }; 684 $[pluginNS]=function(method){ 685 if(methods[method]){ 686 return methods[method].apply(this,Array.prototype.slice.call(arguments,1)); 687 }else if(typeof method==="object" || !method){ 688 return methods.init.apply(this,arguments); 689 }else{ 690 $.error("Method "+method+" does not exist"); 691 } 692 }; 693 694 /* 695 allow setting plugin default options. 696 example: $.plugin_name.defaults.option_name="option_value"; 697 */ 698 699 $[pluginNS].defaults=defaults; 700 701})(jQuery,window,document);
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.