DevShed - How Mike's Site is Built
★ wanayoo — archive 1999 http://www.devshed.com/Client_Side/DHTML/Mikes_Site/Nouvelle recherche | Portail wanayoo

Developer Shed
Friday, 10.08.99  

HOME > CLIENT SIDE > DHTML > ARTICLE    SOURCE

Power Search
Free Newsletter:


Client Side
DHTML
Graphics
JavaScript

Server Side
Administration
ASP
JServ
MySQL
PHP
Python
Roxen
Zend
Zope
Web Hosting

Tools
HTML Editors
Graphic Editors
FTP Programs

Dev Talk
Forums
Mailing List
Brain Dump
Feedback

ClipScripts
Add script
Edit script


Advertise
on DevShed
How Mike's Site is Built
By Mike Hall
March 25, 1999


This site itself uses DHTML to create the look of a Windows 95 desktop. It consists of three frames, one for the icons and start menu at left (1), a frame containing this page which is layed out to resemble a windowed application (2) and one directly below it that contains the rest of the desktop taskbar (3).

Both Netscape Communicator 4 (NS4) and MS Internet Explorer (IE4) are supported. But since dynamic HTML is implemented differently in each, different objects and methods are used to create the dynamic effects. Both browsers support style sheets but the differences between NS4 and IE4 makes it too unwieldly to use them for both, so the NS4 version uses layers while the IE4 version uses style sheets.

To tell which browser is being used, checks are made in the JavaScript code for the existence of a certain object ('document.layers' for NS4 and 'document.all' for IE4) to determine what code to execute. This is useful because it also prevents scripting errors from occuring in older versions of both browsers, allowing for some backward - compatibility.

First, JavaScript is embedded in the pages to create the proper HTML code (either layers or style sheets) as the page is being loaded via 'document.writeln()' statements.

These layers or style sheets are used for the taskbar and start menu, allowing for the them to always be placed at the bottom of the browser window even if the window is resized by repositioning them using the 'onResize' event handler in the <body> tag to rerun the proper function.

The start menu remains hidden until the start button is pressed. Once displayed, start menu items are highlighted when the mouse pointer passes over them using image rollovers (each item is actually a separate image). The menu is hidden again whenever the mouse button is click in any frame using event capturing. NS4 does this by capturing the 'onMouseDown' event while IE 4 uses the 'onClick' event handler in the <body> tag.

The bulk of the code is in menu.html while taskbar.html contains some of the same code for positioning the taskbar and handling a mouse click in it's frame. Each of the window-like pages includes the code in onclick.js to handle mouse clicks in that frame.

Mike's site is available at: • http://members.aol.com/MHall75819/index.html


Click here to discuss this article
with other readers
. 6 comments.


Click here to receive updates on the latest articles.



Now Available:

Click to Order!

Search for books on DHTML

Tech News:
• MP3.com And I-drive Make A Deal
• Russia Denies Infiltrating U.S. Systems
• Developers Disclose OS 9 Holes
• Cell Phones Banned From Planes: Safety Issue Or Economic Incentive
•  More news..

Hot Forum Topics
MySQL passwords in PHP scripts
Temporary web page creation?
ht://dig cfg
sending forms



Copyright © 1997-99 ngenuity. All rights reserved. Privacy Policy.