To Notes

IT 130 -- 11/13/08

 

Rounding a Floating Point Number to Arbitrary Precision

 

JavaScript Examples for the Website Project

 

Practice Problems

  1. Modify the Slide Show Example to:

    1. Show random images.

    2. Show a random image when the page is loaded. The image should not change until the page is reloaded.

 

More Examples with Buttons and Images

  1. Use a button to manually advance a slide show:

  2. Use the mousedown and mouseup events and two images to simulate pressing and releasing a button. Also incorporate the mouseover and mouseout events to change an image.

  3. Use a link instead of a button to advance the slideshow.

  4. Use a button instead of a link to change pages.

    To change the page with JavaScript, change the document.URL property.

 

Disappearing Acts and Other Magic Tricks

 

Changing Background Color Dynamically

  1. Change the background color dynamically with the document.bgColor property. The hex color code is constructed from values stored in an array.

  2. Change the background color by using the getElementById function to get the body and then changing the backgroundColor property of the body style. Use a user defined rgb function to get the hex color code corresponding to r, g and b values.

 

Final Website Project