0

I use this code for scrolling my div

mydiv.addEventListener('mousewheel', function(e)
    {
    var col = 255;
    if(e.wheelDelta/120 > 0)
        {
        if(col < 245)
            {
            col+=10;
            }
        this.scrollTop = this.scrollTop-25;
        }
    else
        {
        if(col > 10)
            {
            col-=10;
            }
        this.scrollTop = this.scrollTop+25;
        }
    });

It run without problems in Opera, in Firefox it make nothing, and at the first, no errors, so that I don't know where the problem is.

hsuk
  • 6,770
  • 13
  • 50
  • 80
BASILIO
  • 847
  • 2
  • 12
  • 26

1 Answers1

1

Firefox does not support the mousewheel event at this point in time.

It instead supports the DOMMouseScroll event.

http://www.sitepoint.com/html5-javascript-mouse-wheel/

3dgoo
  • 15,716
  • 6
  • 46
  • 58
  • Thank you very, i hate so much when Browser Developers user different words for the same things. – BASILIO Jan 16 '13 at 12:34