• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Zoom in and out feature

Explorer ,
Nov 02, 2017 Nov 02, 2017

Copy link to clipboard

Copied

Hello,

Is there a  way to create a zoom in and out feature with using mouse scrolling?

Thanks

Views

476

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 03, 2017 Nov 03, 2017

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

...

Votes

Translate

Translate
LEGEND ,
Nov 02, 2017 Nov 02, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 03, 2017 Nov 03, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 03, 2017 Nov 03, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 03, 2017 Nov 03, 2017

Copy link to clipboard

Copied

Okay!

Thank you so much

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 03, 2017 Nov 03, 2017

Copy link to clipboard

Copied

LATEST

I'll mark my new answer as correct, if that's ok!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 03, 2017 Nov 03, 2017

Copy link to clipboard

Copied

Please place a feature request with the team using this link Feature Request/Bug Report Form

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines