Copy link to clipboard
Copied
Hello,
Is there a way to create a zoom in and out feature with using mouse scrolling?
Thanks
For ActionScript you could read articles like this one:
Flash Mouse Wheel Support | Hook - Labs
For HTML5 Canvas, here's what @klad suggested in another post:
document.getElementById('canvas').addEventListener('mousewheel',f.bind(this));
document.getElementById('canvas').addEventListener('DOMMouseScroll',f.bind(this));
function f(e){
//e.detail
}
Exactly like that it's not the whole answer, there is wheelDeltaY, so this will give you a useful number about how quickly the user was wheeling:
document.getEl
...Copy link to clipboard
Copied
Yes, hold down the Command key (Ctrl on Windows I would think), and mouse wheel. It's a shame they didn't use the alt/option key to make it the same as Photoshop and Illustrator.
Copy link to clipboard
Copied
Hello,
That is not what I meant. Can we create a zooming feature on our project. Like build one on our image so when a user runs the website they are able to zoom in and out on the image.
Thank you
Copy link to clipboard
Copied
For ActionScript you could read articles like this one:
Flash Mouse Wheel Support | Hook - Labs
For HTML5 Canvas, here's what @klad suggested in another post:
document.getElementById('canvas').addEventListener('mousewheel',f.bind(this));
document.getElementById('canvas').addEventListener('DOMMouseScroll',f.bind(this));
function f(e){
//e.detail
}
Exactly like that it's not the whole answer, there is wheelDeltaY, so this will give you a useful number about how quickly the user was wheeling:
document.getElementById('canvas').addEventListener('mousewheel',f.bind(this));
document.getElementById('canvas').addEventListener('DOMMouseScroll',f.bind(this));
function f(e){
alert(e.wheelDeltaY);
}
But, read articles like this about how that only works in some browsers, and for other approaches:
mousewheel - Event reference | MDN
Once you have a usable value you would then need more code to sensibly scale the image.
Copy link to clipboard
Copied
Okay!
Thank you so much
Copy link to clipboard
Copied
I'll mark my new answer as correct, if that's ok!
Copy link to clipboard
Copied
Please place a feature request with the team using this link Feature Request/Bug Report Form