Commit f77853a2 by Masaru Abe

#12408 ホイール対応

parent ef9454d5
......@@ -3681,15 +3681,16 @@ function setDefaultEvent() {
//#12408 ホイール対応
// MouseScrollEvent に対応している(FireFox 専用)
if(window.MouseScrollEvent){
console.log("addEventListener DOMMouseScroll");
//console.log("addEventListener DOMMouseScroll");
document.getElementById('main').addEventListener('DOMMouseScroll', function(event){
mouseWheel_CanvasMain(event, event.detail);
}, false);
// FireFox 以外の主要ブラウザの場合
}else{
console.log("addEventListener mousewheel");
document.getElementById('main').addEventListener('mousewheel', function(e){
mouseWheel_CanvasMain(event, event.wheelDelta);
//console.log("addEventListener mousewheel");
var mousewheelevent = 'onwheel' in document ? 'wheel' : 'onmousewheel' in document ? 'mousewheel' : 'DOMMouseScroll';
document.getElementById('main').addEventListener(mousewheelevent, function(e){
mouseWheel_CanvasMain(event, -(e.wheelDelta / 40));
}, false);
}
......
......@@ -957,7 +957,7 @@ function onClick_CanvasMain(event) {
function mouseWheel_CanvasMain(event, detail) {
//console.log("mouseWheel:" + detail);
event.preventDefault();
//event.preventDefault();
if(_isTouching){
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment