Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting focus to a DIV
Message
De
28/09/2012 11:43:31
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
28/09/2012 09:37:36
Information générale
Forum:
HTML5
Catégorie:
HTML
Divers
Thread ID:
01553827
Message ID:
01553842
Vues:
38
>I have a DIV. This DIV does not always contains a form. But, once this DIV is shown, it needs to receive the focus. IE supports loDiv.focus(), for example. That works. But, Firefox does not support that. So, we have to come up with a workaround for Firefox. One idea was to create a form which just one INPUT Type=Text on top of my div and set the focus to that field. But, the problem is that such an approach requires to hide the form. And, of course, as you would have known it, if a form is hidden, it cannot receive a focus. In order for something to receive a focus, it need to be visible. But, some of my DIV does not contain a form thus this complicates things to have the focus on it.
>
>Any idea?

Move the form to negative coordinates, just like we did in Fox. It will be formally visible, just off the viewport.

I've seen this used for other purposes (one version of autogrow editbox did that), although it didn't move the form - the form was there already - it created ghost versions of other controls at -10000, -10000.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform