perfect-scrollbar/src/perfect-scrollbar.js

13 lines
424 B
JavaScript
Raw Normal View History

2012-11-06 21:00:37 +08:00
/* Copyright (c) 2012 HyeonJe Jun (http://github.com/noraesae)
* Licensed under the MIT License
*/
((function($) {
$.fn.perfectScrollbar = function() {
2012-11-06 21:35:27 +08:00
$(this).mousewheel(function(e, delta, deltaX, deltaY) {
$(this).scrollTop($(this).scrollTop() - (deltaY * 10));
$(this).scrollLeft($(this).scrollLeft() + (deltaX * 10));
e.preventDefault();
});
2012-11-06 21:00:37 +08:00
};
})(jQuery));