The onactivate , onbeforedeactivate , and ondeactivate Events


The onactivate , onbeforedeactivate , and ondeactivate Events

The onactivate event occurs in an object when that object becomes the active element in the document (as with the focus or setActive methods ). The onbeforedeactivate event occurs when an object is the active element and is about to be deactivated (as when another object is going to become the active element), and the ondeactivate event occurs when an object is deactivated. You can find the support for these events in Table 6.55.

Table 6.55. The onactivate , onbeforedeactivate , and ondeactivate Events

Method

NS2

NS3

NS4

NS6

IE3a

IE3b

IE4

IE5

IE5.5

IE6

onactivate

               

x

x

onbeforedeactivate

               

x

x

ondeactivate

                 

x

Only elements that can accept the focus can become the active element. Unless you're specifically handling the case when an element becomes the active element and gets the focus (a document can have only one active element, and that element is stored in the activeElement property), it's probably a good idea to stick to the onfocus and onblur events.



Inside Javascript
Inside JavaScript
ISBN: 0735712859
EAN: 2147483647
Year: 2005
Pages: 492
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net