rajeevgade / react-360

A Simple and Beautiful 360° Product Viewer built on React.js
https://react-360.vercel.app/
MIT License
44 stars 17 forks source link

Disable mouse scroll zoom #21

Open amhep opened 2 years ago

amhep commented 2 years ago

When you use mouse scroll to navigate the page while your mouse is over the turntable, the image zooms in an undesirable way. Is there a way to disable zoom on mouse scroll?

koushayeganeh commented 1 year ago

try this: it worked for me: replace container360 with the id that you gave to your threesixty component

useEffect(() => { const container = document.getElementById("container360"); container.addEventListener("wheel", (event) => { event.stopPropagation(); }); return () => { container.removeEventListener("wheel", (event) => { event.stopPropagation(); }); }; }, []);