Questions tagged [mousedown]

Mousedown is a browser event that occurs when a user clicks the mouse button down on an element.

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

416 questions
5
votes
2 answers

How can I change the background color of multiple divs by dragging over them with the (clicked) mouse?

Please have a look at this example. I have 4 divs here with white background. When I click on a div, its background changes into blue. When I click it again background switches back to white. Now I want to highlight multiple divs by dragging over…
user2994453
  • 145
  • 6
5
votes
3 answers

Capturing click outside of a absolute positioned div

http://jsfiddle.net/dgjJe/1/ In the above jsfiddle I am trying to capture when the user clicks outside of the .inner div but I can't seem to get it working. HTML:
Amir
  • 2,249
  • 7
  • 34
  • 48
5
votes
2 answers

How to draw and move shapes using mouse in C#

I'm new to programming in C# and wanted to ask for a little bit of help. I'm currently trying to move a color-filled rectangle that I draw on a Windows Application form with my left mouse button, and I'm trying to drag-and-drop it to another…
User_T
  • 247
  • 3
  • 8
  • 18
5
votes
2 answers

How to get the control under the mouse cursor in onMouseDown event?

I have a TGridLayout filled with some images in a Firemonkey HD Application. In the gridLayout's onMouseDown event I want to get the image object on which the user has clicked, but I have only mouse coordinates. Implementing onMouseDown event for…
iPath ツ
  • 2,468
  • 20
  • 31
4
votes
2 answers

How to do a work when mousedown until mouseup?

I'm making a simple player motion in Javascript canvas. (Up down left right) I created 4 buttons on screen for mobile players. I used the following code for the buttons as I wanted to move the player until the button is…
Ruthvik
  • 790
  • 5
  • 28
4
votes
2 answers

How to implement tap + hold (long press) on Leaflet map?

I'm trying to create a tap+hold event to create a new marker location (tap + hold event is only for mobile apps); these event handlers are not working as expected (there is some override taking place) I tried using map.on('touchstart'...),…
Greg Rowles
  • 191
  • 2
  • 11
4
votes
0 answers

How to fix [Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot

I want to handle 'touchstart' event for my mobile site. It worked fine, but now it causes an error in the console. I tested it with my Galaxi S7 Chrome v72.0 browser, and inspected it with chrome://inspect/#devices extension. And when I tried touch…
4
votes
1 answer

Why can I off a mousedown event, but not its chained mouseup event?

I have two chained mouse-events: $('body > form').on("mousedown", function(e){ //Do stuff }).on("mouseup", function(){ /*More stuff, including window.addEventListener(... */ }); However, when I try to off() them both from…
rudminda
  • 137
  • 12
4
votes
0 answers

jQuery mouseup() occasionally not firing after button release

I have created a sketchpad, let's call it, which you can hover over and it will change color wherever your mouse is if your left button is pressed, giving the effect of drawing on the sketchpad. When you release the button it should of course stop…
Burkely91
  • 902
  • 9
  • 28
4
votes
3 answers

Jquery mousedown/mouseup prevent click

My page is built like that: …
Yukuza
  • 53
  • 1
  • 5
4
votes
2 answers

How to catch 1 tap with 3 fingers (NSEvent) on a custom NSView?

I have to following code to catch mouseDowns on my custom NSView but I think this only catches how many taps (using the clickCount), not how many fingers were used to tap: - (void)updateTrackingAreas{ if(trackingArea != nil) { [self…
Pedro Vieira
  • 3,330
  • 3
  • 41
  • 76
4
votes
2 answers

How to check the current mouse button state Using Javascript

I want the state of mouse on Down state or on up state document.onmousemove = mouseMove; document.onmousedown = mouseDown; document.onmouseup = mouseUp; function mouseMove(ev) { mouseState=""; //How can I know the state button of mouse…
vusan
  • 5,221
  • 4
  • 46
  • 81
4
votes
1 answer

Cannot unbind mousemove with pageX and pageY

var mouseStillDown = false; $(".grab").mousedown(function(e) { mouseStillDown=true; getLocation(); }).mouseup(function(e) { mouseStillDown = false; getLocation(); }); if(mouseStillDown)…
CodeOverRide
  • 4,431
  • 43
  • 36
3
votes
4 answers

jQuery Image Swap for mouse-over and mouse-down

What I want to achieve: I want an image swap to occur first when the cursor is over the image (mouse over) and second when the image is clicked (mouse down click). Example: I have an image of a green arrow. For the mouse over, it's swapped for an…
Dominor Novus
  • 2,248
  • 5
  • 29
  • 35
3
votes
1 answer

MouseMove event with Right Mouse Button pressed in Safari doesn't work

I'm trying to make a game map in HTML with Javascript. I want the map to move by holding the right mouse button and moving the mouse. In Firefox and Google Chrome this works correctly, but in Safari it's not working. Is there any way to make the…
troyanskiy
  • 31
  • 1
1 2
3
27 28
Test
...... ......