I have a login box that slides down when the 'login' link is clicked.
It also is set to automatically focus on the first input in the login
box when it slides down.  The problem is that the focus only happens
for a brief second until the toggle effect is complete.  Then the
focus is gone.

Here's the code I'm using:
<code><pre>$("a.login").click(function() {
  $("#loginbox").slideToggle("fast");
  $("#hidebox").slideToggle("fast");

  // Focus on first input
  $("#loginbox :input:enabled:first").focus();

  return false;
});</pre></code>

Any ideas what I'm messing up here?  Thanks in advance.

Reply via email to