Hi.

I have a page where <div>s are displayed using a nice simple parallel
Fade/Appear effect. I also fade in the <div>s on the initial page
load.

In some of the <div>s, there are <input> tags. I want to be able to
set focus to the tag.

Trying to do so generates an error.

My fade in code is

new Effect.Parallel(    [
        new Effect.Appear('banner',      {duration : 1.00, delay : 0.50}),
        new Effect.Appear('vsContainer', {duration : 2.00, delay : 0.50})
        ],
        {sync: true}
);

In vsContainer, there is an element <input type="text" maxlength="10"
name="vsRequest[Vehicle]" id="requestVehicle" value="" />

I want to put the focus on this element.

Normally,

$('requestVehicle').focus();

would do the trick, and if I type that into the console (chrome,
firefox, IE8), then it works just fine.

But not when placed immediately after the effect, I get an error -
essentially $('requestVehicle') is null.

I've tried using ...

myFocus(el){el.focus();}

myFocus.defer('requestVehicle');

But nope.

What would be nice is if there was a way to chain the focus call to
the end of the Effect.Parallel code. If Effect.Parallel fired an event
when the job was finished (for example).

Any ideas?


-- 
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to