인간세상의 종말이 도래해따/Programming
[jquery] horizontal scrolling using mousewheel event
민곰
2021. 12. 10. 00:19
728x90
$('#target').on('mousewheel', function(evt) {
evt = window.event || evt;
var delta = Math.max(-1, Math.min(1, (evt.wheelDelta || -evt.detail)));
this.scrollLeft -= (delta * 30); // scroll speed : 30
evt.preventDefault();
});
728x90