I'm trying to focus the cursor in a text box at the end of a simple
animation, and it won't. The cursor shows up temporarily in the box, then
flits away.
$(#orderFinder).SlideToggleUp(250, null, 'bounceout');// show/hide the
div
$(#orderFinder input).val('').focus();
Use:
$(#orderFinder input).val('')[0].focus()
--Francesco
Paul ha scritto:
I'm trying to focus the cursor in a text box at the end of a simple
animation, and it won't. The cursor shows up temporarily in the box,
then flits away...
$(#orderFinder).SlideToggleUp(250, null,
Thanks for the reply, Francesco. Your suggestion didn't seem to work-but
what is the purpose of the [0] there?
_
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Francesco Sullo
Sent: Friday, March 09, 2007 12:25 PM
To: jQuery Discussion.
Subject: Re: [jQuery] simple
It references the first matching element. It's array notation.
_
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Paul
Sent: Friday, March 09, 2007 2:24 PM
To: 'jQuery Discussion.'
Subject: Re: [jQuery] simple - focusing on an input
Thanks for the reply, Francesco. Your
PM
To: 'jQuery Discussion.'
Subject: Re: [jQuery] simple - focusing on an input
It references the first matching element. It's array notation.
_
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Paul
Sent: Friday, March 09, 2007 2:24 PM
To: 'jQuery Discussion.'
Subject
on an input
It references the first matching element. It's array notation.
_
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Paul
Sent: Friday, March 09, 2007 2:24 PM
To: 'jQuery Discussion.'
Subject: Re: [jQuery] simple - focusing on an input
Thanks for the reply, Francesco
.'
Subject: Re: [jQuery] simple - focusing on an input
By the way I solved this by putting the .focus() function in the
callback for SlideToggleUp()...
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Andy Matthews
Sent: Friday, March 09, 2007 1
.
Subject: Re: [jQuery] simple - focusing on an input
Paul,
So you understand, the array notation Francesco originally brought up is in
order to get the DOM element you searched for.
A jQuery object is an array DOM elements even if there is only one entry.
So, if you wanted to use
PROTECTED] On
Behalf Of Paul
Sent: Friday, March 09, 2007 2:07 PM
To: 'jQuery Discussion.'
Subject: Re: [jQuery] simple - focusing on an input
Thanks Alex. To be clear, how does one differentiate between the jQuery
helper function .focus() and the native browser function of the same
name