Questions tagged [mouseup]

Mouseup is a browser event that occurs when a user release the mouse button (lets it up) on an element.

Mouseup is a browser event that occurs when a user releases the mouse button on an element. It usually occurs right after a mousedown event (when the user clicks the mouse button down), and is part of an onclick event, which comprises both the click down and release of the mouse.

220 questions
42
votes
16 answers

Cancel click event in the mouseup event handler

Writing some drag&drop code, I'd like to cancel the click events in my mouseup handler. I figured preventing default should do the trick, but the click event is still fired. Is there a way to do this? This doesn't work:
Yaron
  • 2,053
  • 2
  • 19
  • 21
19
votes
2 answers

Does jQuery mouseup event work on touch devices?

I couldn't find any answer so I'm asking here. Currently I don't own any touch devices so I can't test it. The following code hides all subcontainers in a container if clicked outside of it. $(document).mouseup(function(e) { var container =…
Rafff
  • 1,510
  • 3
  • 19
  • 38
16
votes
3 answers

ng-touchstart and ng-touchend in Angularjs

I have an element which fires functions on ng-mousedown and ng-mouseup. However, It doesn't work on touch screen, is there any directive like ng-touchstart and ng-touchend?
ciembor
  • 7,189
  • 13
  • 59
  • 100
15
votes
1 answer

Mouseup lost when leaving iframe: leads to reversed input

TL;DR question: How can some javascript tell the window that the mouse button has been released? The mouseup event is being lost because of a cross-domain iframe. I can detect that the problem has happened but I don't know what to do to cure it. If…
Ross Presser
  • 6,027
  • 1
  • 34
  • 66
8
votes
2 answers

Jquery Find if Event is a scrollbar click

I have a scenario where I am hiding a Div block if I click any where out side that div block. I am using Internet explorer and testing the application. My code works fine if there is no scroll bar. If there is a scroll bar on the div block then when…
Kurkula
  • 6,386
  • 27
  • 127
  • 202
8
votes
2 answers

detect mouseup outside of mousedown element

I am trying to detect when the mouseup (mouse button released) occurs outside of the element that the mousedown event was triggered on. I have several buttons that I alter the CSS (by using classes) with a mousedown (button press) and completion of…
Rob Emenecker
  • 129
  • 1
  • 1
  • 9
8
votes
1 answer

Mouseup not working after mousemove on img

I'm trying to do a simple drag script. The idea is to save the position when the mouse is down, update the view while the mouse is moving, and stop when mouse is up. Problem, mouseup event isn't working properly. See the code: var target =…
leyou
  • 806
  • 1
  • 13
  • 25
7
votes
2 answers

Detecting Left and Right Mouse Events for a Canvas Game

I want to implement a canvas minesweeper game using plain javascript. I use 2D array for my grid. For the game, I need to detect right and left mouse clicks, each of which will do different things. My research directed me towards mousedown, mouseup,…
nkarmyan
  • 83
  • 1
  • 1
  • 4
7
votes
3 answers

MouseUp and DoubleClick both attached to seperate event handling functions using Backbone js

I have a chart application wherein I use Backbone.js to attach seperate handlers for mouseup and doubleclick events over different "area" of chart image. I require mouseup to detect whether user clicked left button or right on the "area" part of…
Vidhi
  • 387
  • 2
  • 11
7
votes
4 answers

jQuery mouseup not firing after drag off link

See this jsfiddle: http://jsfiddle.net/CB87X/6/ Click and hold the button, drag off the button and release. As you can see, the mouseup event never fires if the mouse is not over the element when the mouse button is released. Thus, the styling in my…
preahkumpii
  • 1,301
  • 4
  • 21
  • 36
6
votes
2 answers

NSView does not receive mouseUp: event when mouse button is released outside of view

I have a custom NSView subclass with (for example) the following methods: override func mouseDown(with event: NSEvent) { Swift.print("mouseDown") } override func mouseDragged(with event: NSEvent) { Swift.print("mouseDragged") } override func…
MrMage
  • 7,282
  • 2
  • 41
  • 71
6
votes
1 answer

jQuery mouseup function on left mouse button only?

I have this element which animates on a mouseup function, but right now, it works for both the left and right buttons. Is there any way to only use the left button? $(document).ready(function() { $("div").mouseup(function() { top:…
ModernDesigner
  • 7,539
  • 10
  • 34
  • 41
6
votes
3 answers

How to know the current state of mouse button(mouseup state or mousedown state)

In Javascript, when I click on a scrollbar (Any scrollbar that appears in the page) and hover over the image, the image again start to drag. Image should only be drag on mousebutton down state. So I tried to tackle this problem by knowing the mouse…
vusan
  • 5,221
  • 4
  • 46
  • 81
6
votes
3 answers

jQuery event to stop on mouseup

I am trying to make a very simple application where the user can draw into a table with a selected color when the mouse button is down, and the event stops when the mouse is up. The drawing works well, the only problem is that the event doesn't stop…
Zoltan
  • 163
  • 2
  • 12
5
votes
3 answers

GoogleMaps loses mouseUp event if rectangle redrawn in mouseMove event

The following code sample has me baffled. It's the simplest version of a larger piece of code that I can use to demonstrate my problem. Basically I want the user to be able to draw a bounding box by holding down the mouse key and dragging it. If…
1
2 3
14 15