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
0
votes
1 answer

Javascript conflict between onmousedown and onmousemove

I have developed a volume controller in pure JavaScript. The mouse move works fine but unfortunately I am unable to make it a perfect volume controller. There are two issues facing on the function: Volume not changing on mouse click onmousemove…
Mo.
  • 26,306
  • 36
  • 159
  • 225
0
votes
3 answers

How to display items of a particular div on mouseover

I have the div structure
0
votes
3 answers

Onmousedown in JavaScript not working --help!

The following function is supposed to execute during the "onload" event of my webpage. function setUpTranslation() { var phrases = document.getElementsByTagName("p"); for (i = 0; i
Ashley
  • 1,125
  • 8
  • 16
  • 27
0
votes
1 answer

How do I show a gui.button after clicking on a specific object or disable gui.button until after click?

So far I have this script: Using UnityEngine; using System.Collections; public class text : MonoBehaviour { public GameObject mainCam; public bool showButton = false; void OnGUI () { // Make a background box GUI.Box(new…
Kala J
  • 2,040
  • 4
  • 45
  • 85
0
votes
2 answers

PHP HTML Hyperlink Quotes Issue

I am trying to output a list of links based upon database query result. The query works fine but I need to get the information for the links to populated by the same results. In this example I need to create the following string to pass along to my…
GMORROW
  • 5
  • 1
0
votes
2 answers

Move Depending on Mouse State

I need my users to be able to move an element away from the mouse pointer by holding the left button down, and the element should move closer when the button is up. So far, I have this: var divName = 'follow'; // div to follow mouse // (must be…
0
votes
1 answer

Prevent onmousedown elements from overlapping, becoming visibly nested

I have a few hidden divs which reveal themselves "onmousedown." However, you have to click the link twice for the hidden content to disappear. I'd like the content to disappear when you click any other "onmousedown" link on the page, instead of…
user2985093
  • 63
  • 1
  • 2
  • 13
0
votes
2 answers

Handle multiple clicks when making an object move

I have the following: var player = $('#player'); //Checks to see which key is pressed down $(window).on('mousedown', function (e) { console.log(e.offsetX + ', ' + e.offsetY); player.animate({ left: e.offsetX + 'px', top:…
Nilzone-
  • 2,766
  • 6
  • 35
  • 71
0
votes
2 answers

Incorporating OnMouseUp/Down Functionality?

I have a working tool (see first code block), where I would like to include click-and-hold functionality. I would like to to rapidly ADD when left button is held, and rapidly SUBTRACT when right button is held. Just like the single click…
user2811882
  • 67
  • 1
  • 2
  • 8
0
votes
1 answer

Clicakble planets

Im trying to make planets that give an alert message when clicked. Problem is, onmousedown only works on canvas, as far I tested. Code for planets: var planets = []; for (var b=0;b<3;b++)…
none
  • 9
  • 2
  • 6
0
votes
1 answer

handling mouse events in runtime created objects in c#

I'm writing a c# windows app, and as one task, I am creating Panel objects at runtime. I have my custom Panel which is defined as: class FlowState : Panel { : : } I have an init method to set size, location, etc. However once this panel is…
Brett McCann
  • 2,469
  • 2
  • 27
  • 44
0
votes
3 answers

Creating mousedown event with global scope

I am hacking on something to fix another problem that is a constraint of the system. Not ideal, but.. Anyway, I need to generate a click/touch then find out the topmost element under the poing (300, 300). I am using: event = $.Event( "mousedown",…
Alexis
  • 23,545
  • 19
  • 104
  • 143
0
votes
1 answer

Adding an onMouseDown attribute equivalent to each anchor's HREF attribute in a class or document

I'm having trouble getting an onMouseDown function that takes each link and copies the original HREF attribute of its respective anchor tag in a page and loads the URL on the down event. Let's call this function loadURL(). Right now I'm testing the…
DAF487
  • 3
  • 5
0
votes
1 answer

JS onmousedown limited to left-click

I have built a sort of picture gallery in JS. On given img and p elements, the onmousedown events calls two functions: it loads a new image and a new description (see below) But, as opposed to what I was thinking, the onmousedow it is triggered by…
0
votes
2 answers

javscaript multiple values

I am recently trying to send multiple values to a javascript function, something like: from what I know, that is not possible, I was wondering though if there is any way to send those…
Gnu_nix
  • 25
  • 1
  • 6
1 2 3
13
14