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

animate html canvas how to set Screen zoom with Javascript

Participant ,
Mar 29, 2020 Mar 29, 2020

I have made an AnimateCC HTML Canvas with input Elements. On Smartphone by clicking inside an input Element the Document is zoomed in. How can I zoom out with Javascript to see the complete canvas Element on the screen of the smartphone? In other words how can I scale the canas Element with Javascript. I put the Javascript in the first Frame.

TOPICS
Code , How to
1.4K
Translate
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 , Mar 30, 2020 Mar 30, 2020

Browser zoom is a user agent setting and therefore cannot be changed with JavaScript.

 

What you can do is add a viewport meta tag to prevent the browser from scaling the page.

https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag

 

Translate
LEGEND ,
Mar 29, 2020 Mar 29, 2020

Your question is confusingly phrased. Do you want to zoom in then zoom back out, or do you want to not zoom at all?

Translate
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
Participant ,
Mar 30, 2020 Mar 30, 2020

Excuse my bad english.

Take a look at this example on a smartphone I hope this will show the problem

https://www.on-design.de/test/franz/win7.html

There are input Fields, when you play the game. The smartphones zooms in as soon as the focus is in the input field. Even though I have put a big font-size for the input field. A big font-size is the normal procedure for stopping that zooming. But this does not work  for Animate CC (Jquery) input components.

So thats the problem. So As I cant stop this automatic zooming. I am looking for a command to zoom out after the user has put some text in the input field, or after he has clicked a button.

Translate
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 ,
Mar 30, 2020 Mar 30, 2020
LATEST

Browser zoom is a user agent setting and therefore cannot be changed with JavaScript.

 

What you can do is add a viewport meta tag to prevent the browser from scaling the page.

https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag

 

Translate
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