Click to See Complete Forum and Search --> : Can anyone help with this focus script?


mitya
10-31-2003, 08:23 AM
Hi all

I'm trying to make the body lose focus when a layer is made visible, i.e. nothing on the body can be clicked or effected while the layer shows.

I've successfully 'disabled' the body when it shows (i.e. disabled = true) but, rather uselessly, everything can still be clicked, selected etc.

You might have guessed that I'm trying to avoid modal dialogue boxes because they're ugly. It would be great if I could do this via a hidden/showing layer, and just lock the body out for the duration of the layer being shown.

Can anyone assist? Thanks ain advance.

Khalid Ali
10-31-2003, 08:50 AM
how about capturing onclick event in the body and setting the focus to the layer if its visibility=visible or display:block...

mitya
10-31-2003, 08:57 AM
THanks for your reply Khalid but unfortunately, not being much of a JS programmer, I'm not exactly sure how to effect your suggestions.

Could you perhaps be a little more specific so I can give them a go?

Thanks a lot.