Возможно, комунибудь будет интересно решение этой проблемы.
window.requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
function( callback ){
window.setTimeout(callback, 1000 / 60);
};
})();
var SmoothScroll = function(){
this.init();
};
SmoothScroll.prototype = {
dirOfChange: 0,
scrollTop: 0,
init: function(){
this.bindEvents();
this.render();
},
bindEvents: function(){
var self = this;
$('html, body').on('mousewheel', function(e){
e.preventDefault();
var change = e.originalEvent.wheelDelta/120 || -e.originalEvent.detail/3;
change = change * 7;
self.scrollTop -= change;
if(change > 0){
self.dirOfChange = -1;
}else{
self.dirOfChange = 1;
}
});
},
render: function(){
var self = this;
window.requestAnimFrame(function(){
self.render();
});
if (this.dirOfChange < 0) {
if (this.scrollTop > -1) {
this.scrollTop = 0;
return;
}
} else {
if (this.scrollTop < 1) {
this.scrollTop = 0;
return;
}
}
TweenMax.set($('html, body'), {
scrollTop: "+=" + this.scrollTop
});
this.scrollTop *= 0.9;
}
};
var ss = new SmoothScroll();