JavaScript
  Home arrow JavaScript arrow Page 3 - Understanding The JavaScript Event Mod...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

Understanding The JavaScript Event Model (part 2)
By: Team Melonfire, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 29
    2002-07-10

    Table of Contents:
  • Understanding The JavaScript Event Model (part 2)
  • Back To Basics
  • How's The Weather Up There?
  • X Marks The Spot
  • Enter The Stalker
  • Of Keys And Clicks
  • A Few Modifications
  • Tonight's Menu
  • Reducing The Crime Rate
  • Endgame

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Route your faxes to your email inbox. Private, secure fax numbers available from CallWave. Choose your fax number.

    Understanding The JavaScript Event Model (part 2) - How's The Weather Up There?
    (Page 3 of 10 )

    The "height" and "width" properties return the height and width of the window or frame containing the generated event. Here's how it works:

    In this example, on clicking the form button an alert box appears, stating the height of the document:

    <html>
    <head>
    </head>
    <body>
    <form>
    <input type="button" value="Click Me" onClick="alert('This document is '
    + document.height + ' pixels tall')"> </form>
    </body>
    </html>
    Or you could even do this:
    <html>
    <head>
    <script language="JavaScript">
    function changeWidth() 
    {
    document.width=40
    }
    </script>
    </head>
    <body>
    <form>
    <input type="button" value="Click Me" onClick="changeWidth()"> </form>
    This is a really, really, really, really, really, really, really,
    really, really, really, really, really, really, really, really, really,
    really, really, really long string.
    </body>
    </html>
    Now, when you click the button, you'll see that the document width reduces to 40 pixels, and the incredibly long sentence gets cropped to exactly that width.

    Before you get all excited, though, you should know that the "width" and "height" properties only work in Netscape Navigator 4.x.

    More JavaScript Articles
    More By Team Melonfire, (c) Melonfire


     

       

    JAVASCRIPT ARTICLES

    - Getting Attention with Interactive Effects
    - Interacting with Tooltips and Previews
    - Just-in-Time Information and Ajax
    - Interactive Effects
    - Using Cookies With JavaScript
    - Understanding the JavaScript RegExp Object
    - Controlling Browser Properties with JavaScri...
    - Using Timers in JavaScript
    - Form Validation with JavaScript
    - JavaScript Exception Handling
    - Stringing Things Along
    - Understanding The JavaScript Event Model (pa...
    - Understanding The JavaScript Event Model (pa...
    - An Object Lesson In JavaScript




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway