I have an image in a page and in the "onmouseover" event of that image I will call a javascript function to show a tooltip and in the "onmouseout" of the image, i will call a method to hide the tooltip.Now i found that when i place the cursor on the image,its calling the method to show the tooltip div.and if i move the mouse WITHIN the image,Its calling the onmouseout event(Even if i am not OUT of the image).How can i stop this . I want onmouseout to be called when i the cursor is out of the image ? Any thoughts ? Thanks in advance
Here is how i call it
<img src="images/customer.png" onmouseout="HideCustomerInfo()" onmouseover="ShowCustomerInfo(485)" />
and in my javascript
function ShowCustomerInfo(id) {
var currentCustomer = $("#hdnCustomerId").val();
if (currentCustomer != id) { // to stop making an ajax call everytime when the mouse move on the same image
$.get('../Lib/handlers/userhandler.aspx?mode=custinfo&cid=' + id, function (data) {
strHtml = data;
});
tooltip.show(strHtml); // method in another jquery pluggin
$("#hdnCustomerId").val(id);
}
}
function HideCustomerInfo() {
tooltip.hide(); // method in another jquery pluggin
$("#hdnCustomerId").val(0); //setting in a hidden variable in the page
}