var getscroll = function() { $.getScript("script/mousewheel.min.js"); $(window).bind('mousewheel', function(event, delta, deltaX, deltaY) { if (deltaY < 0) { t = $("body").scrollTop(); t = t - t % height; $(document.body).animate({ 'scrollTop': t + height }, 700); } else if (deltaY > 0) { t = $("body").scrollTop(); t = t - t % height; $(document.body).animate({ 'scrollTop': t - height }, 700); } }); } getscroll();