Questions tagged [onmousemove]

The "onmousemove" event is a event that is triggered when the user moves the mouse pointer on an element.

Definition:

The onmousemove property is a JavaScript property which triggers the mousemove event when the user moves the mouse over an object.

Example Usage:

document.getElementById( '#example' ).onmousemove = function ()
{
    console.log( 'The onmousemove event has fired.' );
};

Important Links:

199 questions
52
votes
5 answers

clearRect function doesn't clear the canvas

I'm using this script on the body onmousemove function: function lineDraw() { // Get the context and the canvas: var canvas = document.getElementById("myCanvas"); var context = canvas.getContext("2d"); // Clear the last canvas …
Carlos Roldán
  • 902
  • 1
  • 9
  • 19
40
votes
12 answers

Detect mousemove when over an iframe?

I have an iframe that takes up the entire window (100% wide, 100% high), and I need the main window to be able to detect when the mouse has been moved. Already tried an onMouseMove attribute on the iframe and it obviously didn't work. Also tried…
Charles Zink
  • 3,482
  • 5
  • 22
  • 24
21
votes
4 answers

onMouseMove get mouse position

In Javascript, within the Javascript event handler for onMouseMove how do I get the mouse position in x, y coordinates relative to the top of the page?
Andrew Chang
  • 211
  • 1
  • 2
  • 3
12
votes
3 answers

How to determine the direction on onmousemove event?

On some condition I want to cancel onmousemove event when mouse goes down, for example. Is it possible to determine the direction of onmousemove event? jQ or JS is Ok. I have drag’n’drop elements. The user drags the elenment up. If, for example, the…
Green
  • 28,742
  • 61
  • 158
  • 247
11
votes
2 answers

Simple pure Javascript drag controller slider

Hi Developers all over the world. I would like to have some help with a simple, pure Javascript (30 lines), JQuery free (and other library's) drag control slider. I have been searching months and found many scripts but i don't like -Jquery cause…
Stone Pentecost
  • 270
  • 1
  • 2
  • 11
10
votes
4 answers

Mouse cursor not changing if a pointer is not moved in Webkit-based browsers

Let's assume that we have simple jQuery code like the following: var $document = $(document); $document.ready(function() { var $test = $("#test"); $document.keydown(function(e) { e.shiftKey && $test.css("cursor", "pointer"); …
Lyubomyr Shaydariv
  • 20,327
  • 12
  • 64
  • 105
9
votes
3 answers

A tooltip or something similar move with cursor in WPF

Is it possible to move a Tooltip or something like that with cursor when mouse goes on a specific control? I tried TextBlock, but Margin property not work. private TextBlock tooltip = new TextBlock(); private void imgRoom_MouseEnter(object…
Jalal
  • 6,594
  • 9
  • 63
  • 100
9
votes
2 answers

Show mouse x and y position with JavaScript

First version does not show me x and y and get I get following error: Uncaught TypeError: Cannot read property 'pageX' of undefined The Second version works but is very similar coded, can't find the problem. FIRST VERSION (NOT WORKING)
user1010563
8
votes
1 answer

Triggering :hover on moving element without moving mouse

#box { animation: scroll 2s linear infinite; width: 100px; height: 100px; background: red; } #box:hover { background: green; } @keyframes scroll { from {transform: none;} to {transform: translateX(400px);} }
cozycone
  • 175
  • 6
8
votes
3 answers

Why does OnMouseMove fire repeatedly when the mouse is not moving in D2010?

I'm porting a Delphi 5 app to D2010, and I've got a bit of a problem. On one form is a TImage component with an OnMouseMove event that's supposed to update a label whenever the mouse is moved over the image. This worked just fine in the original…
Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
7
votes
2 answers

onmousemove event does not fire from within external source?

I am loading up an external webpage (i.e. www.duckduckgo.com in this example) within a div on my webpage. I want to get my mouse X and Y position while within and outside the div, but when I am inside the div, it seems that the webpage blocks the…
Code Doggo
  • 2,146
  • 6
  • 33
  • 58
6
votes
2 answers

How do I change the mouse cursor when the left mouse button is down?

In Delphi 2007, in a mouse move event, I try to change the mouse cursor with: procedure TFr_Board_Display.PaintBox_Proxy_BoardMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin if left_mouse_button_down then begin if…
Rich J
  • 73
  • 1
  • 1
  • 6
6
votes
1 answer

How can I use javascript timing to control on mouse stop and on mouse move events

So I have a control (a map) on an aspx page. I want to write some javascript to onload setup the following: when mouse stops on control = some code when mouse moves = some code (but only if the move is longer than 250 mil sec) This works to…
mrjrdnthms
  • 1,549
  • 4
  • 24
  • 35
6
votes
2 answers

See if left mouse button is held down in the OnMouseMove event

How do I detect if the left mouse button is being held down in the OnMouseMove event for a control?
SchwartzE
  • 2,558
  • 5
  • 30
  • 39
6
votes
2 answers

How to return Lat/Long with MouseMove in GMap.net

I am trying to put together a c# program with GMap, and I'd like the coordinates where the mouse is to show up on the bottom of the screen. I've added an OnMouseMove method to the form, and I do get coordinates out, but only if the mouse is not…
user2791846
  • 61
  • 1
  • 2
1
2 3
13 14