Is there any way when people open the web page with a couple of images and when the viewer puts his mouse in a certain area span outside of the image, the mouse is attracted to the image just like a magnet? Is it possible to do? Please suggest.
Asked
Active
Viewed 3,438 times
3
-
This may help you : [Move the mouse pointer to a specific position?](http://stackoverflow.com/questions/4752501/move-the-mouse-pointer-to-a-specific-position) – Anujith Feb 27 '13 at 06:36
-
@A.V Thank you for the link. But the image should attract the mouse pointer just like a magnet attracts iron particles if it is in a certain area span outside it. Can this be possible? – programmer Feb 27 '13 at 06:43
-
You can't move the mouse, but you could make the mouse the "magnet", and move the image. – jches Feb 27 '13 at 06:55
4 Answers
2
No. You can't controll mouse pointer with JavaScript.

Daniil Ryzhkov
- 7,416
- 2
- 41
- 58
-
Is there any other way to do the same thing in an html page? I am not an expert on JQuery. But can JQuery do this? – programmer Feb 27 '13 at 06:39
-
1
2
There is no way for any webpage to force the user's mouse to a certain location. Allowing this would have huge malicious repercussions.
An alternative might be when the user hover's over the specified area, the image grows to fill the area.

Michael Johnston
- 2,364
- 2
- 27
- 48
1
Amazon filed a patent regarding gravity-based links, that would, somewhat, be similar to what is discussed here...
I would love to see how this could be done in jQuery too, tho !

HYCday
- 11
- 1
0
Yes. You can control mouse pointer with JavaScript.
Here is a very beautiful example from Codrops.
There are a lots of others you can find on codepen.io.
Here is one: NodeCursor.
$(function() {
// init plugin
NodeCursor({
cursor: true,
node: true,
cursor_velocity: 1,
node_velocity: 0.15,
native_cursor: "none",
element_to_hover: ".nodeHover",
cursor_class_hover: "disable",
node_class_hover: "expand",
hide_mode: true,
hide_timing: 2000
});
});

Tomáš Pánik
- 556
- 1
- 5
- 18