BASILIO
BASILIO

Reputation: 887

Div scrolling in Firefox

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.

Upvotes: 0

Views: 287

Answers (1)

3dgoo
3dgoo

Reputation: 15794

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/

Upvotes: 1

Related Questions