The ondblclick Event


The ondblclick Event

The ondblclick event occurs when the user double-clicks an object. You can find the support for this event in Table 6.66.

Table 6.66. The ondblclick Event

Event

NS2

NS3

NS4

NS6

IE3a

IE3b

IE4

IE5

IE5.5

IE6

ondblclick

   

x

x

   

x

x

x

x

When a user double-clicks an element, an onclick event occurs after the first click, and then an ondblclick event after the second click.Virtually all visible objects in the Internet Explorer from version 4.0 on support ondblclick ,but support in the Netscape Navigator is much more limitedthe Netscape Navigator 4.0 supported this event for link objects only, for example.

Here's an example that responds by displaying a message when you double-click a web page:

(Listing 06-14.html on the web site)
 <HTML>      <HEAD>          <TITLE>Using the ondblclick Event</TITLE>          <SCRIPT LANGUAGE="JavaScript">              <!--  function display()   {   document.form1.text1.value = "You double clicked this Web page!"   }  // -->          </SCRIPT>      </HEAD>  <BODY ONDBLCLICK="display()" ID="body1">  <H1>Using the ondblclick Event</H1>          <FORM NAME="form1">              <INPUT TYPE="TEXT" ID="text1" SIZE="60"></INPUT>          </FORM>      </BODY>  </HTML> 

You can see the results in Figure 6.9.

Figure 6.9. Using the ondblclick event.

graphics/06fig09.gif



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