id="time_out"
![]() ![]() ![]() ![]() |
1. (50 points) The clock (on the left -- currently 100 pixels square) is made from 4 images. It now displays: 7:00:50.
| ||||||||||||||||||||||||||||||||||||||||||
Only the white or red pixels are visible in the "sec0000 thru sec0059 images AND in the clk0000 thru clk0059 images. All other pixels in the images are transparent. All pixels are visible in the tick0000.gif above.
When the "p1" button is clicked a javascript function named p1 is executed. This sub has one line of code: vt_name2 = setInterval ("p3",1000). This code creates a interval timer that executes the sub named p3 every 1000 milliseconds (i.e., every second). Using document.getElementByID("id value").style.css property, document.getElementById("id value").src or innerHTML, change the ten CSS property and src values shown in the ten shaded cells below in the sub p3. Show NO HTML, Show only the javascript for p3.
|
<base_url>http://www.spacetelescope.org/images</base_url> <archive_url> http://www.spacetelescope.org/static/archives/images/screen/ </archive_url> <page><rank>1</rank><page_name>heic1107a</page_name><txt>A rose made of galaxies</txt></page> <page><rank>2</rank><page_name>heic0715a</page_name><txt>Extreme star cluster bursts into life in new Hubble image</txt></page> <page><rank>3</rank><page_name>heic0706a</page_name><txt>Stellar Nursery in the arms of NGC 1672</txt></page> <page><rank>100</rank><page_name>opo9935c</page_name><txt>Hubble's Variable Nebula (NGC 2261)</txt></page> </hubble> This is the DIV with id="p2out"
|
2. (50 points) Information about the top 100 Hubble Space Telescope images are summarized in the XML structure shown to the left. This XML is stored inside an XML tag with id="h". A portion of the XML is shown to the left. When the user clicks this button: ,
a javascript function named p2 is executed. This function retrieves the XML and creates a 4 column table
showing all the Hubble data as follows:
in column 1: display the rank (1 to 100) in column 2: make a link to the page like this: <a href="base_url/page_name/">page_name</a> in column 3" display the image (the image file is "page_name.jpg") -- like this: <img id='rank' width='100' src='archive_url/page_name.jpg onmouseover='makebig(rank)' [Note: this function sets width to 600px] onmouseout='makesmall(rank)'>" [Note: this function sets width back to 100px] [Note: the "id" for the image is same as its rank value] in column 4: display the txt value The javascript functions makebig and makesmall use the id (i.e., rank) to change the image width. Both these functions are already written. DO NOT WRITE THEM. Place the table data in the DIV block with id="p2out". Show only the javascript for p2. Show NO HTML. Notes: |