Commit f77853a2 by Masaru Abe

#12408 ホイール対応

parent ef9454d5
...@@ -3681,16 +3681,17 @@ function setDefaultEvent() { ...@@ -3681,16 +3681,17 @@ function setDefaultEvent() {
//#12408 ホイール対応 //#12408 ホイール対応
// MouseScrollEvent に対応している(FireFox 専用) // MouseScrollEvent に対応している(FireFox 専用)
if(window.MouseScrollEvent){ if(window.MouseScrollEvent){
console.log("addEventListener DOMMouseScroll"); //console.log("addEventListener DOMMouseScroll");
document.getElementById('main').addEventListener('DOMMouseScroll', function(event){ document.getElementById('main').addEventListener('DOMMouseScroll', function(event){
mouseWheel_CanvasMain(event, event.detail); mouseWheel_CanvasMain(event, event.detail);
}, false); }, false);
// FireFox 以外の主要ブラウザの場合 // FireFox 以外の主要ブラウザの場合
}else{ }else{
console.log("addEventListener mousewheel"); //console.log("addEventListener mousewheel");
document.getElementById('main').addEventListener('mousewheel', function(e){ var mousewheelevent = 'onwheel' in document ? 'wheel' : 'onmousewheel' in document ? 'mousewheel' : 'DOMMouseScroll';
mouseWheel_CanvasMain(event, event.wheelDelta); document.getElementById('main').addEventListener(mousewheelevent, function(e){
}, false); mouseWheel_CanvasMain(event, -(e.wheelDelta / 40));
}, false);
} }
if (avwUserEnvObj.browser == 'msie') { if (avwUserEnvObj.browser == 'msie') {
......
...@@ -957,7 +957,7 @@ function onClick_CanvasMain(event) { ...@@ -957,7 +957,7 @@ function onClick_CanvasMain(event) {
function mouseWheel_CanvasMain(event, detail) { function mouseWheel_CanvasMain(event, detail) {
//console.log("mouseWheel:" + detail); //console.log("mouseWheel:" + detail);
event.preventDefault(); //event.preventDefault();
if(_isTouching){ if(_isTouching){
return; 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