javascript - Cannot hold div when select email from autocomplete list -
below script create effect fade in , fade out when user hover mouse login box
<script> $("#login").hover(function() { $("#loginform").slidetoggle('500').css('display', 'block'); }, function() { $("#loginform").slidetoggle('500') }); </script>
but when want select email <input type="name" name="email_address" />
this div #loginform
automatically closed :
so how keep box show when user select email address autocomplete list ?
this issue happen in browser mozilla firefox.
fyi : change <input type="name" name="email" />
.. list gmail email address
as drop-down created browser, jquery thinks mouse leaves #login
, slide again. prevent happening, add delay slideup
animation. created fiddle show mean.
$("#login").hover(function () { $("#loginform").clearqueue().slidedown(500); }, function () { $("#loginform").delay(1500).slideup('500'); });
note clearqueue()
method. make sure when user has selected email , has mouse on element #login
prevent slideup()
happening.
Comments
Post a Comment