What Is an HTML Hover?
Most computer operating systems that accept user input actually break down each seemingly simple action into a sequence of stages, or events. Web browsers must be able to interpret and respond to these events so users can interact with a web page. These events are generated by the computer system in response to a user action, passed to the web browser, and then made available to any active programs that are listening for the events attached to the HTML page.
When a mouse cursor passes over an element in an HTML document, it actually generates at least three separate events. The first is when the mouse initially comes into contact with the element, which is known as an enter or onMouseEnter event. The last event generated when the mouse leaves the element is called an exit or onMouseExit event. The period of time in which the mouse is sitting inside the element between these two events is known as hovering, and it generates an HTML hover event. One thing to note about hovering is that a mouse does not always have to sit perfectly still to be considered hovering, the event can be automatically triggered just by entering the elements space.
Navigation assistance is one common use for an HTML hover event, popping up some informational text at the location of the mouse cursor when a link or image is passed over. It also can used to provide short textual definitions of words in a document. More often, it is used for aesthetic purposes, such as making graphical dials or arrows animate when the mouse gives them focus. Although there are many security precautions to prevent it, particularly malicious code can sometimes use an HTML hover event over a blank space on a web page to cause pop-up windows to appear outside the web browser.
Discuss this Article
Post your comments