4

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

Problem:
I use javascript preventDefault(); and stopPropagation(); to cancel the default scroll event by mouse wheel, it work fine. But when mouse over the flash object and scroll by mouse wheel, this is not working.

Indeed, I have a panel in flash which can controlled by mouse wheel. The flash object is embed in the middle of the html document, which you need to scroll down in the browser to view the flash content. When I focus on flash content and scroll by mouse wheel, the browser is also scrolling and make the flash content out of view.

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

  1. To make it easy to explain, you can use this javascript to stop all mouse wheel activity on the page: (please press "Spacebar" to reach flash object at the very bottom in the html, if needed)

    window.addEventListener('DOMMouseScroll', wheel, false); window.addEventListener('mousewheel', 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; }

  2. Mouse roll over on the flash object and use the scroll wheel, you will find the browser is also scrolling.

Expected Result:
Mouse wheel only control the flash object, but not the browser by the above script.

1
  • @MuratÇorlu nope.... I reported to Mozilla as a bug but have no reply at that time. Apr 8, 2013 at 5:05

3 Answers 3

1

I have come across a site where that has an entire order process in a flash object but that object is a fixed size that does not fit on my laptop screen. They have disabled scrolling in and outside the flash object object, that is, the entire page. An absolutely infuriating user experience where I have to move mouse pointer to far right and use the browser scroll bar instead of a mouse wheel. Does this site "https://internetorder.dominos.com.au/estore/" (any page past main page) behave like that for you, if so, it may provide a way for you to inflict it on your users. Not that I in any way endorse this.

1
  • Update: the referenced site in my previous comment has replaced flash and no longer is relevant.
    – Skip R
    Mar 24, 2014 at 2:08
0

you'll need to use javascript to override the default mouse wheel behavior. the 1st link has lots of examples in different browsers, but i had better luck with implementation in modern IE based on the 2nd 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 really sure why you need this. if you make you flash application the same size as the screen and scale the inner content there's no way to scroll the page. just set the width and height of your flash to 100%

2
  • Thanks for your reply. But the some problem still happen in Firefox 17. Jan 5, 2013 at 9:22
  • My flash object will be embed in the third-party website, and the size of the flash object is needed to fit into the provided skin. Jan 5, 2013 at 9:31
0

I created a small lib that handles everything for you. It works perfect (as far as I tested) on default flash player plugin, on Pepper flash and on MAC-OS. And you don't need to add any .js files to your HTML folder

GIhub repo

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.