![]() | ||||||||||||||||||||||||||||||||||||||||||||
![]()
Gallery Software Data Files Reference: HTML Tags Appendix D: JavaScript Objects, Properties, Methods, Event Handlers Appendix E: JavaScript Operators, Elements, Keywords Appendix F: Cascading Style Sheets | Working with the Event Model | |||||||||||||||||||||||||||||||||||||||||||
Displaying Character Codes |
It's sometimes hard to keep track of all of the character codes. You can use the following utility to display the codes for each character in your window's status bar. if (isNS) document.captureEvents(Event.KEYPRESS); You can test this code by pressing a keyboard key. The character and code should appear in your browser's status bar (see DHTML Tutorial 5 for a description of the properties of the browser's status bar.)
If you create a drag-and-drop page that contain form elements, be aware that Netscape Navigator does not allow objects to hide form elements. For example, if your page contains a form button, the button will always appear on top of any dragable item, no matter what z-index value you assign to the object. This problem does not exist with Internet Explorer.
When you drag an object on the Web page that contains text, your browser might also select the text within the object. If you want to keep this from happening, you can enter the following code: document.onselectstart=stopSelect; In this example, dragItem is the dragable object discussed in DHTML Tutorial 4. Note that this technique does not work for Netscape Navigator.
Internet Explorer 5.0 introduces expressions which allow you to add scriptable values to your style sheets. For example, one popular task is to create an object that stays in one location in the browser window. To do this without expression, requires the creation of a script that automatically moves the object in response to scrolling or resizing events in the browser window. To do this with an expression, you can use the following style declarion: #object {top: expression(document.body.scrollTop + document.body.clientHeight - offsetHeight); where object is the ID name of the object on the page. In this example, object will always be placed on the lower left corner of the browser window. Netscape Navigator does not support expressions. Internet Explorer users:
DHTML Tutorial 4
| ||||||||||||||||||||||||||||||||||||
| Website design by SKDesigns. |