Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery force mouse move and click

Demo: http://jsfiddle.net/thisizmonster/VRPDa/

Purpose:

  1. Mouse must move to button position (button position must auto calculate)
  2. Fire mouse click event

How do it?

Edited/Added

Since everyone said I can't move mouse coordinate, I think its failed. Btw my main purpose is because of Facebook Comment plugin. By default its shows "by social ranking". My requirement is default by "Reverse Chronological". But plugin itself placed in iFrame, So I can't access its elements. So I decided after page loaded, quickly move mouse and choose option and revert back mouse coordinate. Its failed I think :(

like image 278
Gereltod Avatar asked Sep 11 '11 05:09

Gereltod


People also ask

How to move mouse using jQuery?

jQuery | mousemove() with ExamplesThe mousemove() method is an inbuilt method in jQuery which is used when mouse pointer moves over the selected element. Parameters: This method accepts single parameter function which is optional. This parameter is used to specify the function to run when the mousemove event is call.

How do I move my mouse to click?

Mousing Around: Clicking and Dragging. "Clicking and dragging" is a way to move certain objects on the screen. To move an object, place the mouse cursor over it, press and hold down the left mouse button, then move the mouse while still holding down the left mouse button.

How do I trigger a Mousemove event?

The mousemove event occurs whenever the mouse pointer moves within the selected element. The mousemove() method triggers the mousemove event, or attaches a function to run when a mousemove event occurs. Note: Each time a user moves the mouse one pixel, a mousemove event occurs.

What is Mousemove?

The mousemove event is fired at an element when a pointing device (usually a mouse) is moved while the cursor's hotspot is inside it.


2 Answers

  1. Not possible
  2. $('#item').click(); or $('#item').trigger('click'); (use the latter for other triggers like mouseenter
like image 147
Tarek Fadel Avatar answered Nov 15 '22 05:11

Tarek Fadel


Fortunately, you cannot control the mouse-pointer position through Javascript.

like image 22
Joseph Silber Avatar answered Nov 15 '22 04:11

Joseph Silber