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
2
votes
4 answers

jquery - prevent buildup of mousedown with overlaping elements

lets say I have a div nested withing another div and I have a mousedown event to trigger an alert when any of the divs are clicked on. Naturaly the alert displays twice with a single click as the divs are nested. How can I prevent this to alert only…
Phil Jackson
  • 10,238
  • 23
  • 96
  • 130
2
votes
3 answers

Javascript "onmousedown" isn't firing

I'm trying to run a function on an element "onmousedown". Here's the code:
garson
  • 1,505
  • 3
  • 22
  • 56
2
votes
1 answer

Detecting the last time the user clicked/moved/typed/anything

I have a Windows vb.net project that does an occasional "auto refresh" based on a 20 minute timer. I want to avoid any type of auto-refresh... if the user has manually had any interaction with the program (mouse move, click, keystroke, anything)…
Bonnie
  • 161
  • 1
  • 3
  • 6
2
votes
3 answers

Flot: how to add "mousedown" event to a plot holder?

I want to add "mousedown" event to the plot holder in JQuery/Flot code, i tried two ways, but neither works, i appreciate anybody give me any hints! 1) placeholder.bind("mousedown",function(e){ alert("1"); }) 2) function onMouseDown(e) { …
Simon
  • 1,463
  • 6
  • 34
  • 46
2
votes
3 answers

Make Object Follow Mouse On MouseDown and "Stick" On MouseUp

I'm working with a project that is WPF and VB.net. I want to visually simulate "dragging" an object (though I do not want to use standard drag and drop for reason of purpose). Basically, I have a label object that, on its MouseDown event, I want it…
CodeMouse92
  • 6,840
  • 14
  • 73
  • 130
2
votes
5 answers

How to change color of selected row on onmousedown event

I am trying to change the color of the selected row from a table on a onmousedown event and reset all others (or keep them the same) . Only one row can be red at a time while all others are green. What I have tried: function HighLight(id) { var…
Bercovici Adrian
  • 8,794
  • 17
  • 73
  • 152
2
votes
0 answers

How to get cursor position on input field in onmousedown event

I'm developing date selector form field which opens calendar on onmousedown event. One of supported formats is 'yyyy/mm/dd' and depending on where the user clicked (on yyyy or mm or dd part) field opens either years months or days to choose from.…
2
votes
2 answers

JavaScript: onMouseOver Event Not Working Properly With Other Events

I have a HTML webpage that contains a 15x15 table and I also have a small square div that follows the mouse when you press and hold the left mouse button on the div. I have assigned an onmouseover event to the 15x15 table so that when the mouse…
AlexPriceAP
  • 1,987
  • 6
  • 26
  • 41
2
votes
1 answer

Can a PDF Embed onmousedown Javascript Events?

My client has some web pages that have A tag links with onmousedown events on them. My tools are PHP, Linux, and the tools for PDF generation there like DomPDF and PHP PDF. Is there a way to put the links into a PDF with the onmousedown Javascript…
Volomike
  • 23,743
  • 21
  • 113
  • 209
2
votes
1 answer

Drawing to canvas on mouse click is off

My element takes up 100vw and 100vh. I want to be able to click anywhere on it and have a picture drawn there. Right now, when I click on the screen, the image does not get drawn anywhere close to where I click. The closer I click to the…
skyleguy
  • 979
  • 3
  • 19
  • 35
2
votes
2 answers

stop the mouse down event of body on SVG mouse down

Here, i am trying to stop the mouse down event of body when mouse down of SVG if fired. I also tried the event.stopPropagation but here it is not working. Here is my code. var…
Dinesh Pathak DK
  • 185
  • 1
  • 3
  • 15
2
votes
1 answer

How to measure latency between interaction and mousedown event in JavaScript?

Is there a way to measure the latency between when I press my mouse button and when a defined onmousedown function fires? Or, are there current statistics available about this latency? I assume these two events are not simultaneous, and vary by…
suncannon
  • 194
  • 1
  • 9
2
votes
1 answer

onmousedown event stopping input focus

I am handling mousedown & oncontextmenu events to prevent text & image selection, right click and drag. The code is as follows -
Pramod
  • 2,828
  • 6
  • 31
  • 40
2
votes
2 answers

Do OnMouseDown and OnMouseUp only work as a pair?

My application has a lot of TRectangle's acting as keys of a keyboard. When one is clicked you hear a sound. This is done by handling the OnMouseDown and OnMouseUp event. OnMouseDown: send a sound and OnMouseUp: switch it off. All works fine, except…
Arnold
  • 4,578
  • 6
  • 52
  • 91
2
votes
2 answers

How do I write a mouse down event in JavaScript?

This is very basic I'm sure to JavaScript but I am having a hard time so any help would be appreciated. I want to call a function within a for loop using the mouseDown event occurring within an object's second child node. The part italicized is my…
Ashley
  • 1,125
  • 8
  • 16
  • 27
1 2
3
13 14