views:

408

answers:

1

I have a flash element on my page that you interact with by using the middle mouse scroll wheel. The page is long. So when scrolling with the mouse wheel it interacts with the Flash element AND scrolls the browser window.

Is there a way to disable browser scrolling while the Flash element is active?

+2  A: 

You can use:

document.body.style.overflow=allowScroll?"":"hidden";

Where allowScroll is a boolean.

Maz
Very simple, I should have thought of it myself. Now I'm being lazy! So to complete the script, when disabling browser scrolling, simply swtich allowScroll = true/false. Thanks!
Peter