PATH: Instructional Server> COP 1830> Projects>

COP 1830 Project 6 - JavaScript Objects


Purpose:

This project is intended to give students experience in composing a dynamic web page involving [HTML DOM objects] and JavaScript functions. The project will use [event-driven behaviors written as JavaScript functions] to control the way in which the page is formatted and displayed. See the pages about the [HTML DOM Style Object] for help. Look at Chapters F - K in your JavaScript Virtual textbook and review the information about how to produce form checkbox input elements with XHTML. See the page about the [HTML DOM Checkbox Object] for help.

Sample Output:

Project 6 Web Page Illustration

Project Constraints and Objectives:

  1. Use a plain text editor such as the Windows Notepad program to create a web page named "project6.htm" that displays as closely matching the illustration above as possible. You must not use Word, Wordpad, FrontPage, Dreamweaver, or any other web authoring software.
  2. The heading at the top of the page should be a level 2 heading. The other three headings should be level 3.
  3. Use embedded CSS rules to center both levels of heading and all other style definitions necessary to format the page. Assign a background color of #cccccc for the page.
  4. The content under the the headings OBJECTIVES, DETAILS, and SUBMISSION should be created with division (div) elements that also include the headers.
  5. Each division must be given a unique id attribute to identify it to JavaScript functions that will affect it. Name the division elements (in order of appearance): objectives, details, and submission.
  6. One JavaScript function named "divFontSize" must be written to cause a "rollover behavior" for any of the three divisions, such that when a user moves a mouse over them they enlarge to a 25% larger font size and then return to their original size when the mouse moves away from them. (It does not matter if the header changes size or not.) The function must receive two passed parameters that indicate (1) the id of the division to be altered, and (2) the font size to be applied to the division.
  7. Each division must have two "event handler" attributes that will call the divFontSize function and pass the related parameters to it when the mouse: (1) hovers over the division, and (2) moves away from it.
  8. The checkboxes at the top of the page should be positioned within borderless cells in a one row table. The enclosing table element should be formatted with a "groove" style border. Each checkbox must be nested within a label element to ensure that click events on the label will also toggle each checkbox.
  9. A second JavaScript function named "showHide" must be written in the head section that can toggle that division's display on or off, based on the state of the related checkbox. This function also must receive two passed parameters that indicate (1) which checkbox is triggering the event, and (2) the id of the division to be altered. See the use of the HTML DOM 'style.display' property in Chapter F of your Virtual textbook for help. All three divisions must display by default when the page loads.
  10. Each checkbox must be given a unique id attribute to identify it to the showHide function. Name the input checkbox elements (in order of appearance): objchk, detchk, and subchk.
  11. Each checkbox also must have an "event handler" attribute that will call the showHide function and pass the related two parameters to it.
  12. Do not use any images, color, etc., or other multimedia content on this project.
  13. Place a comment in the head section of the html container identifying the filename, yourself as the author, and noting the date.
  14. Use the [W3C Markup Validation Service] to validate your XHTML code under transitional standards as identified by the DOCTYPE tag placed at the beginning of your HTML file as shown below. Also remember to write the appropriate meta tag in the head section to declare the document's charset.

Tips:

Submission:

Login to the and use the Project 6 drop box under the Lessons tab to attach your "project6.htm" file.

PATH: Instructional Server> COP 1830> Projects>