Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9152627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:06:09+00:00 2026-06-17T12:06:09+00:00

I am testing the following code: $(window).bind(‘mousewheel’, function(e) { alert(e.wheelDelta); }); Every time I

  • 0

I am testing the following code:

$(window).bind('mousewheel', function(e) {
  alert(e.wheelDelta);
});

Every time I move the mousehweel, I get “undefined”. Can anyone help with this as I am trying to capture the mousewheel and move a div based on it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:06:10+00:00Added an answer on June 17, 2026 at 12:06 pm

    I think you’ll have to do a little bit more work to get it working in all browsers – or try the jquery-mousewheel extension

    If the extension still does not work properly, you might try this modified version I created a while ago:

    /* jquery.mousewheel.min.js
     * Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
     * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
     * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
     * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
     * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
     *
     * Version: 3.0.2
     * 
     * Requires: 1.2.2+
     */
    (function(c) {
        var a = [ "DOMMouseScroll", "mousewheel" ];
        c.event.special.mousewheel = {
            setup : function() {
                if (this.addEventListener) {
                    for ( var d = a.length; d;) {
                        this.addEventListener(a[--d], b, false)
                    }
                } else {
                    this.onmousewheel = b
                }
            },
            teardown : function() {
                if (this.removeEventListener) {
                    for ( var d = a.length; d;) {
                        this.removeEventListener(a[--d], b, false)
                    }
                } else {
                    this.onmousewheel = null
                }
            }
        };
        c.fn.extend({
            mousewheel : function(d) {
                return d ? this.bind("mousewheel", d) : this.trigger("mousewheel")
            },
            unmousewheel : function(d) {
                return this.unbind("mousewheel", d)
            }
        });
        function b(f) {
            var d = [].slice.call(arguments, 1), g = 0, e = true;
            if (f.wheelDelta) {
                g = f.wheelDelta / 120
            }
            if (f.detail) {
                g = -f.detail / 3
            }
            // I had to move the following two lines down, probably because of jQuery update
            f = c.event.fix(f || window.event);
            f.type = "mousewheel";
            f.pageX = f.originalEvent.pageX;
            f.pageY = f.originalEvent.pageY;
            d.unshift(f, g);
            return c.event.handle.apply(this, d)
        }
    })(jQuery);
    

    I just tested it in Firefox and Chrome, but I don’t know whether it works in other browsers. Usage:

    $('element').mousewheel(function(e, delta) { alert(delta); });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using following code (purely for testing purposes): $(window).bind('unload', function() {alert('unload!')}); $(window).unload(function () {alert(".unload()")});
Hello i'm testing the following code it's suppose to list all apps installed on
I am learning PHP PEAR and testing the following code. However when I login,
I'm testing out crossroads.js and hasher.js together and the following code errors on the
i am having the following code: <Window x:Class=WpfApplication1.MainWindow xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=MainWindow Height=350 Width=525> <Window.Resources>
I am having difficulties testing window.setInterval function in my Javascript file. Below is the
I am using the following JS function to open a pop-up window to display
In the following code, where would I use preventDefault ? I have been testing
When use the Google Closure Compiler advanced optimizations on the following code: function add(v1,
I've been testing the following code, but Firefox16 and Chrome22 gives me different outcomes.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.