Scrolling on wheels only in flash mode. Prevent default browser scrolling with the mouse

I find this problem after my firefox is automatically updated to FF17, MAC, OSX 10.8.2.
Any suggestion and advice?

Problem:
I am using javascript preventDefault (); and stopPropagation (); to cancel the default scroll event using the mouse wheel, it works fine. But when the mouse is above the flash lens and the mouse wheel scrolls, it does not work.

In fact, I have a flash panel that can be controlled by the mouse wheel. The flash object is embedded in the middle of the html document, which you need to scroll in the browser to view the contents of the flash memory. When I focus on flash content and scroll the mouse wheel, the browser also scrolls and makes the contents of the flash memory out of sight.

Reproduce the problem:
1. Put a simple empty flash object at the very bottom in html. Make sure you need to scroll down to view the flash object in the browser.

  • To simplify the explanation, you can use this javascript to stop all mouse actions on the page: (please press the Space bar to reach the flash object at the very bottom in html, if necessary)

    window.addEventListener ('DOMMouseScroll', wheel, false); window.addEventListener ("mouse wheel", wheel, false),
    window.addEventListener ('MozMousePixelScroll', wheel, false); window.addEventListener ("wheel", wheel, false),
    function cancelEvent (e) {e = e? e: window.event; if (e.stopPropagation) e.stopPropagation (); if (e.preventDefault) e.preventDefault (); e.cancelBubble = true; e.cancel = true; e.returnValue = false; return false; }

  • The mouse will roll over to the flash object and use the scroll wheel, you will see that the browser also scrolls.

Expected Result:
The mouse wheel controls only the flash object, but not the browser specified in the script above.

+4
source share
3 answers

I came across a site where it has the entire ordering process in a flash object, but this object is a fixed size that is not suitable for the screen of my laptop. They turned off scrolling of the object of the object of the flash object and outside it, that is, the entire page. A completely unreasonable user experience when I need to move the mouse to the far right and use the browser scroll bar instead of the mouse wheel. This site " https://internetorder.dominos.com.au/estore/ " (any page after the main page) behaves the way you do, if so, it can provide you with a way to harm your users. Not that I in any way supported this.

+1
source

you will need to use javascript to override the default mouse wheel behavior. The 1st link has many examples in different browsers, but I was lucky with the implementation in modern IE based on the second example.

http://www.stoimen.com/blog/2009/07/01/javascript-disable-mouse-wheel/

http://solidlystated.com/scripting/javascript-disable-mouse-wheel/

but I'm not sure why you need it. if you make a flash application the same size as the screen, and scale the internal content where there is no way to scroll the page. just set the width and height of your flash to 100%

0
source

I created a small library that handles everything for you. It works perfectly (as far as I checked) by default the Flash Player plugin, on Pepper flash and on MAC-OS. And you do not need to add any .js files to your HTML folder

Gihub repo

0
source

All Articles