Use mouse wheel for page zoom, click and drag to pan the page
P粉308783585
P粉308783585 2024-03-26 14:11:27
0
1
356

How to use the mouse wheel to create scrolling and panning effects for the entire page? Basically just like any 2D editor, scroll to zoom and click and drag to pan, but for the entire body.

I can't find any information about it online.

P粉308783585
P粉308783585

reply all(1)
P粉466643318

If you don't know where to start, you'll quickly hit a wall because knowing where to start is the easy part. Here's a rough guide:

  1. Add an event listener to the wheel event (Learn how](https://stackoverflow.com/a/51276012/104380 a>))
  2. Starting from the initial (current) zoom value, calculate the increment of wheel events and update %
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template