O'Reilly logo

jQuery Tools UI Library by Alex Libby

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Take control of your mouse with mousewheel

The final part of the Toolbox group of components is mousewheel—this allows you to take control of the mouse wheel, when navigating around a page using a jQuery Tools tool.

Usage

The code for enabling mousewheel is very simple. It involves one call to the mousewheel library, where event is the jQuery event object being controlled, and delta is the amount of movement in the mousewheel. A positive value means that the wheel is being moved up, while a negative value means that the wheel is being moved downwards:

// make #myelement listen for mousewheel events
$("#myelement").mousewheel(function(event, delta) {
});

However, you should note that mousewheel really comes into its own when used as a configuration ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required