Created
June 27, 2016 12:03
-
-
Save amuhororo/b2f53be1f904e327f17b147f9c5adbc5 to your computer and use it in GitHub Desktop.
横スクローーール
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mousewheelevent = 'onwheel' in document ? 'wheel' : 'onmousewheel' in document ? 'mousewheel' : 'DOMMouseScroll'; | |
$(document).on(mousewheelevent,function(e){ | |
if ( TG.config.vertical == "true" ){ | |
var num = $(".log_body").scrollLeft(); | |
e.preventDefault(); | |
var delta = e.originalEvent.deltaY ? -(e.originalEvent.deltaY) : e.originalEvent.wheelDelta ? e.originalEvent.wheelDelta : -(e.originalEvent.detail); | |
if (delta < 0){ | |
var num = num - 100; | |
$(".log_body").scrollLeft(num); | |
} else { | |
var num = num + 100; | |
$(".log_body").scrollLeft(num) | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment