You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

jquery-mousewheel

Package Overview
Dependencies
Maintainers
4
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery-mousewheel

A jQuery plugin that adds cross-browser mouse wheel support.

3.2.2
latest
Source
npm
Version published
Weekly downloads
207K
-4.75%
Maintainers
4
Weekly downloads
 
Created

What is jquery-mousewheel?

The jquery-mousewheel package is a jQuery plugin that adds cross-browser mouse wheel support. It allows you to capture mouse wheel events and respond to them in a consistent manner across different browsers.

What are jquery-mousewheel's main functionalities?

Basic Mouse Wheel Event Handling

This feature allows you to capture mouse wheel events on a specific element and log the delta value, which indicates the amount of scroll.


$(document).ready(function() {
  $("#element").on("mousewheel", function(event) {
    console.log("Mouse wheel event detected!");
    console.log("Delta: " + event.deltaY);
  });
});

Prevent Default Scrolling

This feature allows you to prevent the default scrolling behavior when a mouse wheel event is detected, which can be useful for custom scroll implementations.


$(document).ready(function() {
  $("#element").on("mousewheel", function(event) {
    event.preventDefault();
    console.log("Default scrolling prevented.");
  });
});

Custom Scroll Speed

This feature allows you to customize the scroll speed by multiplying the delta value with a custom speed factor and then adjusting the scroll position of the element.


$(document).ready(function() {
  $("#element").on("mousewheel", function(event) {
    var scrollSpeed = 10;
    var scrollAmount = event.deltaY * scrollSpeed;
    $(this).scrollTop($(this).scrollTop() - scrollAmount);
    event.preventDefault();
  });
});

Other packages similar to jquery-mousewheel

Keywords

jquery

FAQs

Package last updated on 17 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts