平滑滚动的体验非常的爽!

[code] /*SmoothScroll*/ (function() { function C() { if(document.body) { var a=document.body, b=document.documentElement, d=window.innerHeight, e=a.scrollHeight; n=0<=document.compatMode.indexOf("CSS")?b:a; u=a; f.keyboardSupport&&window.addEventListener("keydown", K, !1); D=!0; if(top!=self)E=!0; else if(e>d&&(a.offsetHeight<=d||b.offsetHeight<=d)) { var c=!1; b.style.height="auto"; setTimeout(function() { c||b.scrollHeight==document.height||(c=!0, setTimeout(function() { b.style.height=document.height+"px"; c=!1 } , 500)) } , 10); n.offsetHeight<=d&&(d=document.createElement("div"), d.style.clear="both", a.appendChild(d)) } f.fixedBackground||(a.style.backgroundAttachment="scroll", b.style.backgroundAttachment="scroll") } } function F(a, b, d, e) { e||(e=1E3); L(b, d); if(1!=f.accelerationMax) { var c=+new Date-x; cb?.99:-.99, lastY:0>d?.99:-.99, start:+new Date } ); if(!y) { var g=a===document.body, h=function(c) { c=+new Date; for(var q=0, r=0, t=0; t=f.animationTime, m=n?1:l/f.animationTime; f.pulseAlgorithm&&(l=m, 1<=l?m=1:0>=l?m=0:(1==f.pulseNormalize&&(f.pulseNormalize/=G(1)), m=G(l))); l=k.x*m-k.lastX>>0; m=k.y*m-k.lastY>>0; q+=l; r+=m; k.lastX+=l; k.lastY+=m; n&&(p.splice(t, 1), t--) } g?window.scrollBy(q, r):(q&&(a.scrollLeft+=q), r&&(a.scrollTop+=r)); b||d||(p=[]); p.length?H(h, a, e/f.frameRate+1):y=!1 } ; H(h, a, 0); y=!0 } } function M(a) { D||C(); var b=a.target, d=I(b); if(!d||a.defaultPrevented||"embed"===(u.nodeName||"").toLowerCase()||"embed"===(b.nodeName||"").toLowerCase()&&/\.pdf/i.test(b.src))return!0; var b=a.wheelDeltaX||0, e=a.wheelDeltaY||0; b||e||(e=a.wheelDelta||0); var c; if(c=!f.touchpadSupport)if(c=e) { c=Math.abs(c); h.push(c); h.shift(); clearTimeout(N); c=h[0]==h[1]&&h[1]==h[2]; var g=z(h[0], 120)&&z(h[1], 120)&&z(h[2], 120); c=!(c||g) } else c=void 0; if(c)return!0; 1.2a?b=a-(1-Math.exp(-a)):(b=Math.exp(-1), --a, a=1-Math.exp(-a), b+=a*(1-b)); return b*f.pulseNormalize } var w= { frameRate:150, animationTime:600, stepSize:120, pulseAlgorithm:!0, pulseScale:6, pulseNormalize:1, accelerationDelta:50, accelerationMax:1, keyboardSupport:!0, arrowScroll:120, touchpadSupport:!0, fixedBackground:!0, excluded:"" } , f=w, E=!1, v= { x:0, y:0 } , D=!1, n=document.documentElement, u, h=[120, 120, 120], g= { left:37, up:38, right:39, down:40, spacebar:32, pageup:33, pagedown:34, end:35, home:36 } , f=w, p=[], y=!1, x=+new Date, B= { } ; setInterval(function() { B= { } } , 1E4); var J=function() { var a=0; return function(b) { return b.uniqueID||(b.uniqueID=a++) } } (), N, H=function() { return window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(a, b, d) { window.setTimeout(a, d||1E3/60) } } (), w=/chrome/i.test(window.navigator.userAgent); "onmousewheel"in document&&w&&(window.addEventListener("mousedown", O, !1), window.addEventListener("mousewheel", M, !1), window.addEventListener("load", C, !1)) } )();[/code]
已邀请:

要回复问题请先登录注册