ok
Direktori : /home/importfo/www/applebeautysalon.me/vendor/scroll-with-ease/ |
Current File : /home/importfo/www/applebeautysalon.me/vendor/scroll-with-ease/jquery.scroll-with-ease.min.js |
!function(){$.fn.scrollWithEase=function(e){!function(){function t(){var e=!1;e&&s("keydown",n),y.keyboardSupport&&!e&&u("keydown",n)}function a(){if(document.body){var e=document.body,a=document.documentElement,o=window.innerHeight,r=e.scrollHeight;if(H=document.compatMode.indexOf("CSS")>=0?a:e,g=e,t(),D=!0,top!=self)k=!0;else if(r>o&&(e.offsetHeight<=o||a.offsetHeight<=o)){var n=!1,i=function(){n||a.scrollHeight==document.height||(n=!0,setTimeout(function(){a.style.height=document.height+"px",n=!1},100))};if(a.style.height="auto",setTimeout(i,10),H.offsetHeight<=o){var l=document.createElement("div");l.style.clear="both",e.appendChild(l)}}y.fixedBackground||S||(e.style.backgroundAttachment="scroll",a.style.backgroundAttachment="scroll")}}function o(e,t,a,o){if(o||(o=1e3),f(t,a),1!=y.accelerationMax){var r=+new Date,n=r-C;if(n<y.accelerationDelta){var i=(1+30/n)/2;i>1&&(i=Math.min(i,y.accelerationMax),t*=i,a*=i)}C=+new Date}if(z.push({x:t,y:a,lastX:0>t?.99:-.99,lastY:0>a?.99:-.99,start:+new Date}),!A){var l=e===document.body,c=function(){for(var r=+new Date,n=0,i=0,u=0;u<z.length;u++){var s=z[u],d=r-s.start,f=d>=y.animationTime,p=f?1:d/y.animationTime;y.pulseAlgorithm&&(p=w(p));var m=s.x*p-s.lastX>>0,h=s.y*p-s.lastY>>0;n+=m,i+=h,s.lastX+=m,s.lastY+=h,f&&(z.splice(u,1),u--)}l?window.scrollBy(n,i):(n&&(e.scrollLeft+=n),i&&(e.scrollTop+=i)),t||a||(z=[]),z.length?K(c,e,o/y.frameRate+1):A=!1};K(c,e,0),A=!0}}function r(e){D||a();var t=e.target,r=c(t);if(!r||e.defaultPrevented||d(g,"embed")||d(t,"embed")&&/\.pdf/i.test(t.src))return!0;var n=e.wheelDeltaX||0,i=e.wheelDeltaY||0;return n||i||(i=e.wheelDelta||0),!(y.touchpadSupport||!p(i))||(Math.abs(n)>1.2&&(n*=y.stepSize/120),Math.abs(i)>1.2&&(i*=y.stepSize/120),o(r,-n,-i),void e.preventDefault())}function n(e){var t=e.target,a=e.ctrlKey||e.altKey||e.metaKey||e.shiftKey&&e.keyCode!==T.spacebar;if(/input|textarea|select|embed/i.test(t.nodeName)||t.isContentEditable||e.defaultPrevented||a)return!0;if(d(t,"button")&&e.keyCode===T.spacebar)return!0;var r,n=0,i=0,l=c(g),u=l.clientHeight;switch(l==document.body&&(u=window.innerHeight),e.keyCode){case T.up:i=-y.arrowScroll;break;case T.down:i=y.arrowScroll;break;case T.spacebar:r=e.shiftKey?1:-1,i=-r*u*.9;break;case T.pageup:i=.9*-u;break;case T.pagedown:i=.9*u;break;case T.home:i=-l.scrollTop;break;case T.end:var s=l.scrollHeight-l.scrollTop-u;i=s>0?s+10:0;break;case T.left:n=-y.arrowScroll;break;case T.right:n=y.arrowScroll;break;default:return!0}o(l,n,i),e.preventDefault()}function i(e){g=e.target}function l(e,t){for(var a=e.length;a--;)N[B(e[a])]=t;return t}function c(e){var t=[],a=H.scrollHeight;do{var o=N[B(e)];if(o)return l(t,o);if(t.push(e),a===e.scrollHeight){if(!k||H.clientHeight+10<a)return l(t,document.body)}else if(e.clientHeight+10<e.scrollHeight&&(overflow=getComputedStyle(e,"").getPropertyValue("overflow-y"),"scroll"===overflow||"auto"===overflow))return l(t,e)}while(e=e.parentNode)}function u(e,t,a){window.addEventListener(e,t,a||!1)}function s(e,t,a){window.removeEventListener(e,t,a||!1)}function d(e,t){return(e.nodeName||"").toLowerCase()===t.toLowerCase()}function f(e,t){e=e>0?1:-1,t=t>0?1:-1,(x.x!==e||x.y!==t)&&(x.x=e,x.y=t,z=[],C=0)}function p(e){if(e){e=Math.abs(e),M.push(e),M.shift(),clearTimeout(E);var t=M[0]==M[1]&&M[1]==M[2],a=m(M[0],120)&&m(M[1],120)&&m(M[2],120);return!(t||a)}}function m(e,t){return Math.floor(e/t)==e/t}function h(e){var t,a,o;return e*=y.pulseScale,1>e?t=e-(1-Math.exp(-e)):(a=Math.exp(-1),e-=1,o=1-Math.exp(-e),t=a+o*(1-a)),t*y.pulseNormalize}function w(e){return e>=1?1:0>=e?0:(1==y.pulseNormalize&&(y.pulseNormalize/=h(1)),h(e))}var g,v=$.extend({frameRate:60,animationTime:1e3,stepSize:120,pulseAlgorithm:!0,pulseScale:8,pulseNormalize:1,accelerationDelta:20,accelerationMax:1,keyboardSupport:!0,arrowScroll:50,touchpadSupport:!0,fixedBackground:!0},e),b={frameRate:v.frameRate,animationTime:v.animationTime,stepSize:v.stepSize,pulseAlgorithm:v.pulseAlgorithm,pulseScale:v.pulseScale,pulseNormalize:v.pulseNormalize,accelerationDelta:v.accelerationDelta,accelerationMax:v.accelerationMax,keyboardSupport:v.keyboardSupport,arrowScroll:v.arrowScroll,touchpadSupport:v.touchpadSupport,fixedBackground:v.fixedBackground,excluded:""},y=b,S=!1,k=!1,x={x:0,y:0},D=!1,H=document.documentElement,M=[120,120,120],T={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36},y=b,z=[],A=!1,C=+new Date,N={};setInterval(function(){N={}},1e4);var E,B=function(){var e=0;return function(t){return t.uniqueID||(t.uniqueID=e++)}}(),K=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(e,t,a){window.setTimeout(e,a||1e3/60)}}(),L=/chrome|iPad/i.test(window.navigator.userAgent),R="onmousewheel"in document;R&&L&&(u("mousedown",i),u("mousewheel",r),u("load",a))}()}}();