More information about the Underscore mailing list

[_] Tabbing within javascript widgets

Pete Boere mrpeteb at gmail.com
Tue Dec 1 14:58:00 GMT 2009

check out event delegation with focus and blur events:
http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html

Also the document.activeElement property which you can use to log which
element in the document is currently focussed

In terms of best practices, as long as you provide the user a way to escape
the pop-up (ie. close button) and return to the page where they left then
that's ok

Pete B









2009/12/1 Sam Dwyer <underscore404 at live.co.uk>

>
>
>                Hello [_],
>
>
>
> I'm working on a lightbox style javascript plugin that pops up an
> image with
>
> next+previous buttons and a close button. I want to make it
> so that tabbing
>
> will only jump between the three presented buttons in
> the popup, not go
>
> through the three of them and then continue on the
> page content in the
>
> background.
>
>
> Currently I'm thinking that the best way is to make an array of
> tabbable
> elements when the popup appears and just capture tabs to
> iterate through
> that array setting focus on each one and preventing
> default tab behaviour.
>
> The only other thing I can think of is to dynamically change the tabindex
> of
> the elements as the user tabs, so when it gets to the end element I set the
> first element to be the next tabbed location.
>
>
>
>
> Anyone know if there are any best practices regarding this?
>
>
> Cheers,
> (boy)sam
>
>
>
>
> _________________________________________________________________
> View your other email accounts from your Hotmail inbox. Add them now.
> http://clk.atdmt.com/UKM/go/186394592/direct/01/
> --
> underscore_ list info/archive ->
> http://www.under-score.org.uk/mailman/listinfo/underscore
>