|
May 14, 2000 Clicking Away Windows Tips: May 2000
Yehuda Shiran, Ph.D.
|
|
You have probably noticed applications presenting an About box that closes when the user clicks the mouse anywhere in the box. We'll use JavaScript to apply the same effect to a window. First, here's the code that opens the new window:
You can close the new window by clicking anywhere inside it. We use the following script in the
For more information about events, refer to Column 9, The Navigator Event Model, Column 10, The Internet Explorer Event Model, and Column 11, The Cross-Browser Event Model. For a similar keyboard implementation, see Hot Keys (November 24, 1999). For a live demo, go to Tutorial 1.
People who read this tip also read these tips: Look for similar tips by subject: |