Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This project is not covered by Drupal’s security advisory policy.
A small utility module that allows registration of mouse wheel events through the Mouse Wheel jQuery Plugin.
Usage
To register a mouse wheel event, simply call the mousewheel_add()
function. The following would show an alert box whenever you mouse wheel on the box. See admin/help/mousewheel for more examples.
// Create the object.
echo '<div id="mousewheel-test" style="width:100px; height:100px; background-color:#333;">' . t('Move your mouse wheel here.') . '</div>';
// Create the callback.
$mousewheel_test = 'function mousewheel_test(event, delta) {
alert("Delta: " + delta);
return false; // Prevent default.
}';
drupal_add_js($mousewheel_test, 'inline');
// Register the callback.
mousewheel_add('#mousewheel-test', 'mousewheel_test');
Project information
- Module categories: Developer Tools, Integrations
- By RobLoach on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.