mouseover - jquery mouse out and mouse leave problem -


<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js" type="text/javascript"></script> </head> <body>     <div id="popupcontact"  style="position:absolute;left:100px;top:100px;width:100px;height:50px;background-color:orange;border:1px solid red ;">     </div>     <div id="divtoshow" style="display:none;background-color:green; border:1px solid black;width:200px;height:100px;position:absolute;">     dsfdssd <div><a href="#">rahul</a></div>     </div> </body> </html> <script  type='text/javascript'> $(document).ready(function(){     var popup_pos=$('#popupcontact').offset();     var timer;      $("#popupcontact").mouseover(function() {         if(timer) {             cleartimeout(timer);             timer = null            }         timer = settimeout(function() {             if(!$("#versionselectfield").is(':hidden')){                 $("#divtoshow").css('position',"absolute");                  $("#divtoshow").css('top',popup_pos.top-20);                     $("#divtoshow").css('left',popup_pos.left-20);                   $("#divtoshow").show();                  $("#popupcontact").hide();             }          }, 1000);      });       $("#divtoshow").mouseleave(function() {             if(timer) {                 cleartimeout(timer);                 timer = null                }             timer = settimeout(function() {                 $("#divtoshow").hide();                  $("#popupcontact").show();              }, 500);     }); }); </script> 

hi have following code , when mouse on popupcontact div , mouse out div divtoshow div being shown dont want please ......

q:how not show divtoshow div while mouseout popupcontact div ?
want delay

what

$("#popupcontact").mouseout(function() {       $("#divtoshow").hide();     $("#popupcontact").show(); }); 

?


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -