I need a function that will add a class to a element that the mouse is on now. this has to change when the mouse moves, every were it goes that element should have the extra class.
I know how to get the x and y of a element using this
var mouseX = 0;
var mouseY = 0;
$().mousemove(function (e) {
mouseX = e.pageX;
mouseY = e.pageY;
});
but then how do i get the hole element in order to add the class?
Can any one here help me with this?
This is what i was looking for: