| Homework 8 - Object Model and Event Model | |
|---|---|
| Part 1 | Create a webpage that contains a script that will input a user's name and then display a greeting to the user which contains the name and version of the user's browser, and the user's patform. Use navigator.appName, navigator.appVersion, navigator.userAgent and navigator.platform. The greeting can be displayed as either HTML or XHTML generated output, or by an alert. |
| Part 2 | Create a webpage in which users are allowed to select a page layout and formatting through the use of the className property. Choose among radio buttons, select items and buttons to allow the user to change the background color, font size, font family, font style, and font weight. |
| Part 3 | Create a webpage that contains a script that contains three hotspot labels, "Stop", "Caution", and "Go". When the user mouses over the "Stop" hotspot, the background color of the browser window should turn red. When the user mouses over the "Caution" hotspot, the background color should turn yellow. When the user mouses over the "Go" hotspot, the background color should turn green. When the user mouses off of any of these hotspots, return the background color to the original color of the browser window. |
| Part 4 | Write a script that utilizes a top navigation bar of general links and expands to several specific links when the user does a mouseover on a general link. |
| Extra Credit | Write a Web page that enables the user to play the game of 15. There is a 4-by-4 board (implemented as an XHTML table) for a total of 16 slots. One of the slots is empty. The other slots are occupied by 15 tiles, randomly numbered from 1 through 15. Any tile next to the currently empty slot can be moved into the currently empty slot by clicking on the tile. Your program should create the board with the tiles out of order. The user’s goal is to arrange the tiles in sequential order row by row. Using the DHTML Object Model and the onclick event, write a script that allows the user to swap the positions of the open position and an adjacent tile. [Hint: The onclick event should be specified for each table cell.] |