Questions tagged [mousemove]

For issues relating to setting up, subscribing to, or handling mousemove events.

Mousemove is an event that fires when the user moves the mouse owithin the element you registered the event on.

961 questions
9
votes
3 answers

How does the triggering of mousemove work in Javascript?

I have an object that prints the mouse's x and y positions on every mousemove. It's something like this: $('#canvas').mousemove(function(e){ $('#output').prepend(e.pageX + ',' + e.pageY); }); I've noticed that when you move over the object…
Jelle De Loecker
  • 20,999
  • 27
  • 100
  • 142
9
votes
1 answer

how to animate following the mouse in jquery

OK, this works perfectly fine for following my mouse. // $(document).mousemove(function(e){ $("#follower").css({ 'top': e.pageY + 'px'; 'left': e.pageX + 'px'; }); }); // And this works great for animating the mouse to a clicked…
Joshua Robison
  • 1,868
  • 4
  • 20
  • 24
9
votes
9 answers

jQuery: Fire mousemove events less often

I'm trying to figure out a clean way to aggregate mousemove events so that I ensure my code gets called, but only once every 250-300 milliseconds. I've thought about using something like the following, but was wondering if there was a better…
Topher Fangio
  • 20,372
  • 15
  • 61
  • 94
9
votes
4 answers

Best way to run mousemove only on mousedown with pure javascript?

I do not want any unnecessary loops occurring for mousemove event. So I became interested, in terms of performance/best practice what would be the best way to run mousemove only while mousedown == true? Currently I'm using: var pressedMouse =…
Alyona
  • 1,682
  • 2
  • 21
  • 44
9
votes
1 answer

Zoom canvas area in Delphi

I making something that looks like Paint in Delphi. I found how to make zoom function: procedure SetCanvasZoomFactor(Canvas: TCanvas; AZoomFactor: Integer); var i: Integer; begin if AZoomFactor = 100 then SetMapMode(Canvas.Handle, MM_TEXT) …
DanilGholtsman
  • 2,354
  • 4
  • 38
  • 69
9
votes
2 answers

Horizontal scroll on mouseMove - wide div in smaller div with overflow:hidden (Can't get the math to work)

I'm trying to make a "line" of image thumbs, where it scrolls on mousemove. And I got it to work, but my problem now is that i wanted to make a "padding" on the sides so I doesn't have to have the mouse all the way out to the sides to see the…
martindilling
  • 2,839
  • 3
  • 16
  • 13
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
5 answers

Robot.mouseMove not moving to specified location properly

Whenever I run a mouseMove command for a robot, the mouse doesn't always go to the same location. For example, I have the following code: import java.awt.Robot; import java.util.concurrent.TimeUnit; public class MainBot { public static void…
DarkHorse
  • 963
  • 1
  • 10
  • 28
8
votes
1 answer

Simulate a physical mouse move in Mac OS X

I'm looking for a way to simulate a mouse move event in Mac OS X 10.6. It would have to be defined in mouse units (rather than pixels — that is important!) I need this for an experiment which basically consists of drawing lines. Any ideas are…
Dae
  • 2,345
  • 2
  • 22
  • 34
8
votes
2 answers

Properly keeping track of which (nested) div has mouse-over

I have a (deeply) nested structure of
s. With Javascript, I'd like to keep track of which element the mouse is currently over (i.e., 'has focus'), where more deeply nested elements have priority: I've tried combinations of mouseover, mouseout,…
mhelvens
  • 4,225
  • 4
  • 31
  • 55
8
votes
2 answers

jQuery mousemove performance - throttle events?

We are facing a problem with jQuery event propagation performance connected to mousemove: We have a screen filling canvas and need to track if a user drags the mouse on it, so we have added a mouse move listener on that object like…
Christopher Lörken
  • 2,740
  • 18
  • 17
8
votes
3 answers

Focus follow mouse in vim

I am aware that the mousefocus option is only supposed to work in gVim. But I was wondering, if it's possible to have the console Vim switch to different windows in response to mouse clicks, would it be not possible to easily add following mouse…
Kamil S.
  • 406
  • 3
  • 10
7
votes
2 answers

X11 Mouse Movement Event

When creating a Window in XLib What are the masks I provide to the SetWindowAttributes.event_mask member? What do I have to pass to the 11th paramater of XCreateWindow() What are the Events I am looking for in the main message loop (Where I use…
Matthew Hoggan
  • 7,402
  • 16
  • 75
  • 140
7
votes
1 answer

event.pageX/Y not working on touchmove

Today I had the following thing going on: I had an existing mousemove event and added touchmove later on, like this: $(window).on "mousemove touchmove", (e) -> pos_x = e.pageX pos_y = e.pageY Unfortunately both variables were undefined on…
MyXoToD
  • 620
  • 5
  • 13
7
votes
2 answers

c# reliable MouseMove (hop)

I'm using this function to move the cursor. [DllImport("user32.dll")] static extern bool SetCursorPos(int X, int Y); When I use a hotkey to trigger it, the cursor will move to the correct coords and next time I move the mouse it continues from…
user1340531
  • 720
  • 1
  • 10
  • 21
1 2
3
63 64