Reputation: 12512
I need to change css of an element while a cursor either:
Both .hover() and .mouseover() seem to work fine on toll over, but neither one works for drag over. Is there anything else that would work?
Once the mouse moves away from the element it needs to go back to the previous state.
Thanks.
Upvotes: 0
Views: 1701
Reputation: 10466
just bind both events to the same handler, like so:
var hoverHandler = function(e){
/// do stuff
}
$('#myelement').mouseover(hoverHandler).bind('dragover', hoverHandler);
Upvotes: 2