jQuery: Any chance to detect from which side the mouse entered a div without the “Offset” Method?
Is there a way to detect from which side of a div the mouse cursor came from? Currently i'm using this method: jQuery(this).bind('mousemove',function(e){ offset_pos_x = parseInt(e.offsetX); offset_pos_y = parseInt(e.offsetY); ... Then i look for the distances the mouse went inside the div, in which direction. The Problem is, this method is a bit buggy because i need all 4 sides, not just two, so i have to check offsetX AND offsetY. If i move the mouse inside the div for example X:+15,Y:-3 (in Pixels) i know that the mouse came from left, because the mouse moved 15px on x-axis, but only -3px on