jquery on blur but focus on the other one -


i have situation have hidden div 2 input elements hides default , shows if hover , disappears if hover out. want div not disappear if 1 of input element focused , disappears if blurred. have solved part until, if focus transferred 1 input another, div disappear don't want disappear because 1 of input still focused.

here's code:

// code problem think. $('#inputtext1, #inputtext2').live("blur", function() {     if ($('#mydiv').is(":visible")) {         if (!$(this).hasclass("jqtransforminputwrapper_focus")) {             $('#mydiv').fadeout("slow");         }     } });  // hover show , hide div $(".visiblediv").hover(     function() {         $('#mydiv').fadein("slow");     },     function() {         if(!$(this).find(".jqtransforminputwrapper").hasclass("jqtransforminputwrapper_focus")) {             $('#mydiv').fadeout("slow");         }     } ); 

my html:

<div class="visiblediv">     hover me     <div id="mydiv">         <input name="inputtext1" id="inputtext1" type="text" />         <input name="inputtext2" id="inputtext2" type="text" />     </div> </div> 

btw, i'm using jqtransform input elements.

try this,

// code problem think. $('#inputtext1, #inputtext2').live("blur", function() {      if ($('#mydiv').is(":visible")) {         if (!$(this).hasclass("jqtransforminputwrapper_focus")) {             $('#mydiv').fadeout("slow");         }     }  }).live("focus",function(){     $('#mydiv').stop(true,true).show(); }); 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -