How to call a function after the user release the mouse click?

2

On a page there is an element that the user can drag with the mouse, I would like to call a function after the user drops this element (when they release the mouse click). How to do this without reference to the element, just recognizing that the mouse button is no longer pressed?

    
asked by anonymous 29.07.2015 / 23:29

1 answer

2

mouseup ()

The event is fired when the mouse button is released. Note that the message is only displayed when the mouse button (any one) is released.

Mouseup usage example

$(function(){
    $("#div1").mouseup(function(){
        alert("O botao foi solto.")
    });
});
    
29.07.2015 / 23:40