diff --git a/min/perfect-scrollbar.min.js b/min/perfect-scrollbar.min.js index f62e628..d7bf577 100644 --- a/min/perfect-scrollbar.min.js +++ b/min/perfect-scrollbar.min.js @@ -1,3 +1,3 @@ /* Copyright (c) 2012 HyeonJe Jun (http://github.com/noraesae) * Licensed under the MIT License - */(function(e){e.fn.perfectScrollbar=function(){}})(jQuery); \ No newline at end of file + */(function(e){e.fn.perfectScrollbar=function(){e(this).mousewheel(function(t,n,r,i){e(this).scrollTop(e(this).scrollTop()-i*10),e(this).scrollLeft(e(this).scrollLeft()+r*10),t.preventDefault()})}})(jQuery); \ No newline at end of file diff --git a/src/perfect-scrollbar.js b/src/perfect-scrollbar.js index 2b7071d..c1ea04c 100644 --- a/src/perfect-scrollbar.js +++ b/src/perfect-scrollbar.js @@ -3,6 +3,10 @@ */ ((function($) { $.fn.perfectScrollbar = function() { - // TODO + $(this).mousewheel(function(e, delta, deltaX, deltaY) { + $(this).scrollTop($(this).scrollTop() - (deltaY * 10)); + $(this).scrollLeft($(this).scrollLeft() + (deltaX * 10)); + e.preventDefault(); + }); }; })(jQuery));