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

  • SEARCH
  • Home
  • 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 8021791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:05:29+00:00 2026-06-04T22:05:29+00:00

As per the jQuery docs below code can be used to capture mouseup and

  • 0

As per the jQuery docs below code can be used to capture mouseup and mouse down events. But my requirement is bit different

$("#dic").mouseup(function () {

}).mousedown(function () {

});  

But How can I calculate mouse moving co-ordinates between mousedown position to mouseup position. Please help me on this. How can I apply mousemove event between mousedown and mouseup

  • 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-04T22:05:31+00:00Added an answer on June 4, 2026 at 10:05 pm

    If you need to captue all points the mouse moves through during a drag, bind/unbind a new mousemove handler:

    var allPoints = [];
    $("#dic").mouseup(function (e) {
        $(this).unbind("mousemove", trackPoints);
    }).mousedown(function (e) {
        $(this).bind("mousemove", trackPoints); 
    });
    
    function trackPoints(e) {
        allPoints.push({ x: e.pageX, y: e.pageY });
    }
    

    This way, trackPoints will start firing when the mouse is down and stop when it goes back up.

    You may also want to add a if(e.which == 1) to the top of your mouseup and mousedown handlers so that they perform the bind for a left mouse button only, not middle or right buttons.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the below jquery code I have customized it as per my requirement
I'm trying to modify anchor tag href ausing jQuery as per below, but I
I'm trying to make a jquery selector as per the below code. However, my
I'm using jquery file uploader (per blueimp) and I'm wondering how I can direct
I'm using jGesture jquery library for gesture events. As per the documentation, delta and
Per the code below, I am getting the following message. I am fairly certain
How can I set a jquery ui icon as a background image per a
The jQuery documentation suggests storing additional info per DOMElement using data() . But I'm
How can I get the results from a JQUery Multi-select dropdownlist as called per
How do I remove the buttons in a jquery dialog? Per example, I tried

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.