Having an issue wit mouseup event

Posted by user3680715 on Stack Overflow See other posts from Stack Overflow or by user3680715
Published on 2014-05-28T15:17:15Z Indexed on 2014/05/28 15:24 UTC
Read the original article Hit count: 111

Filed under:
|
|
|
|

Hello everyone I have this code working fine but I want the script to stop on the mouse up event.

Here is an example of what I have now. How can I stop the script on mouse up event so that it looks like it only shows the coordinates when dragging over the image.

Thank you!

http://jsfiddle.net/Hc7x4/20/

$(document).ready(function () {
    $("#map-catcher").mousedown(function (e) {

        $("#map-catcher").mousemove(function (e) {
            $("#coord").text("x:"+e.offsetX+", y:"+e.offsetY);
              return;
        });

         $("#map-catcher").mouseup(function (e) {
          return;
         });        

   });
});

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery