Get started with jquery.event.move CDN

WTFPL licensed

The jQuery.event.move library is an extension for jQuery that simplifies handling of mouse and touch events during element movement.

Tags:
  • touch
  • special
  • event
  • finger
  • move

Stable version

Copied!

How to start using jquery.event.move CDN


$(document).ready(function() {
  // Attach the movestart and moveend event handlers
  $('#myElement').mousemove(function(event) {
    // Prevent default behavior to allow movement tracking
    event.preventDefault();

    // Log the current mouse position
    console.log('Mouse position:', event.pageX, event.pageY);

    // Trigger movestart event
    $(this).trigger('movestart', [event]);
  });

  // Define movestart and moveend event handlers
  $('#myElement').on({
    movestart: function(event) {
      console.log('Mouse has started moving:', event.pageX, event.pageY);
    },
    moveend: function(event) {
      console.log('Mouse has stopped moving:', event.pageX, event.pageY);
    }
  });
});
Copied!
Copied!

All versions