How to make a page zoomable (resizable) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

How to make a page zoomable (resizable)

HTML | CSS | JavaScript - On most websites you can zoom in, just by putting your finger fingers (2) and dragging out (if on iPhone). Same thing on window you just zoom in with your mouse. How do you make element (or the body) Zommable (resizable)?

24th Jun 2019, 8:55 PM
Ginfio
Ginfio - avatar
1 Answer
+ 2
you can add an eventListener for wheel to catch the mouse scroll movement. for pinch in or out gesture you can catch them using touchstart and touchend. first catch both the coordinates where the touches are located in. then on the touch end, do the samething then calculate the difference between them to see the pinch direction. you can also use the touchmove event to make it more interactive
25th Jun 2019, 4:19 AM
Taste
Taste - avatar