Questions tagged [onmousedown]

onmousedown is the event where a mouse button is first clicked (as opposed to when the button is subsequently released, which is onmouseup). This is not specific to any language, so please also include a language tag if applicable.

Most questions with this tag relate to the HTML DOM event, and you can find further information here: https://en.wikipedia.org/wiki/DOM_events#Events

This event is common across many platforms however so you may need to seek additional references.

208 questions
4
votes
2 answers

React OnMouseDown event is not working whereas OnMouseUp is working fine.(on SVG elements)

I am having an svg element on which I need to capture the mousedown event. Here is the code. //code snippet... Code for click handler is as simple as…
Ajinkya Dhote
  • 1,389
  • 3
  • 13
  • 26
3
votes
3 answers

Is onClick Universal for Mouse buttons?

I notice Google use onMouseDown in their search results - for web tracking, seeing keyword and ranking etc. I want to know which is better, onClick or onMouseDown - or do they both support all of the following: middle button, left click, right click…
TheBlackBenzKid
  • 26,324
  • 41
  • 139
  • 209
3
votes
1 answer

onmousedown and onmouseup not working when activated by touchscreen

I have two buttons that are supposed to act as touchscreen controls for a game on my webpage, each button moves the paddle in one direction while it is being held down, and they both do exactly as they are supposed to, but only when they are being…
LlamaButt
  • 431
  • 4
  • 15
3
votes
1 answer

How to detect mouse click and hold in Android browser?

I am writing a webpage that is intended to be viewed on Android phones and hopefully other mobile devices. I am going with a webpage as opposed to an App because it is more platform independent. I would like to perform an operation continuously…
PICyourBrain
  • 9,976
  • 26
  • 91
  • 136
3
votes
1 answer

MouseDown in WinForm ListBox Kills SelectedIndexChanged

I'm writing some code to detect toggling of selections in a WindForms ListBox with MultiSelect turned on. Since SelectedIndexChanged only lets me see what is selected after the click, I was looking for a way to detect what was selected before the…
Mike Malter
  • 1,018
  • 1
  • 14
  • 38
3
votes
2 answers

WPF - Open ContextMenu on left mouse hold down

In Google Chrome I really like the functionality of the left mouse hold down on the Back button to get the full browse history. In my WPF app: for a button with a context menu, how can I open the menu on hold down of the left mouse (and of course…
Reddog
  • 15,219
  • 3
  • 51
  • 63
3
votes
0 answers

mousedown event happens at same time as mouseup event - Javascript/HTML

I'm trying to make a html button send certain string to my localhost socket server.(or even console.logging) and then another when i release it. the sending itself seems to be going fine but the mousedown event only happens when i release the…
3
votes
1 answer

Can I add a bind paste event on mousedown in jQuery?

I want to catch the paste event with right Click and Paste selection on a textarea. What I did is: $(window).bind('paste', function(event) { pasteText(); return false; }); and it works ok. So when the…
novellino
  • 1,069
  • 4
  • 22
  • 51
3
votes
1 answer

Click and drag over multiple divs?

I'm trying to create a real-time drawing tool to help reinforce my JavaScript and node.js skills. I am having a problem with just the JavaScript part. On a 3 by 3 grid, I want it so if you have the mouse down and go over multiple divs, in other…
mre12345
  • 1,087
  • 4
  • 16
  • 23
3
votes
1 answer

GWT - onClick not triggered

I'm having a really weird behaviour on a form. There is a number of text fields with in-line validation, showing an error message below the field if the content is invalid. The validation is triggered on blur. At the bottom of the page there is a…
algiogia
  • 936
  • 2
  • 14
  • 40
3
votes
9 answers

Unity C# OnMouseDown() does not work.. Why?

I have an issue with the OnMouseDown() event. The object this script belongs to is a computer cabinet which can be clicked to execute certain actions. But i'm stuck right on square 1.. I have tried to search the web for this issue for some time now,…
Fluesopp
  • 93
  • 1
  • 1
  • 11
3
votes
2 answers

simulate to change the background color when click the link

I have the following HTML and the java script below to simulate the background color change when the link block is clicked, but it doesn't seem to work. Any reason why? If I have only the onmousedown event handled, the background color will be…
tom
  • 14,273
  • 19
  • 65
  • 124
2
votes
2 answers

How to change color of an html table cell when mouse is down, based on which cell it is hovering over?

Essentially, I want a user to be able to click and hold down their mouse and scroll over any number of cells in the table, as soon as they scroll over a cell it should change color. The thing is that when the user regularly clicks a cell I want the…
2
votes
2 answers

How can I make a right-click behave as a left-click for the purpose of selecting or focusing an object

Event though a right-click (as far as I know) fires a mousedown event, that mousedown seems to be ignored in most cases. I'm currently working on displaying a custom context menu via a right-click, but I'd also like to be able to select an option…
2
votes
4 answers

jQuery can't apply onmousedown to anchor tags

I have a navigation menu like this
haunted85
  • 1,601
  • 6
  • 24
  • 40
1
2
3
13 14