Due: December 6th
20 Points
The objective of this assignment is to use loops and functions to generate a photo album. The photo album is to be displayed in a table
and consist of randomly selected pictures from your "library".
A finished project could look like this:
- The user is to enter the number of rows and columns the table should contain
- The table is to have a border
- The table is to be centered on the page
- The images should be displayed with a width of 150
Instructions for Tables
- Create a function and have it called onload of the body
- Request the number of rows and columns from the user using window.prompts
- Using nested for loops, generate a table with the correct number of rows and columns.
Hint: look at chapter 7 notes !
- Generate a random number and place in each cell
picnum = Math.floor(Math.random()*numpics);
Instructions for images
- Find at least 8 of YOUR OWN images or appropriately documented images from the web
- Create an array of the size of the number of photos in your album
- If you name your images: "img0.jpg", "img1.jpg", ... life is easier :)
- Set the array up to be the names of the images
Consider this:
imgArray[i]="img"+i+".JPG";
- replace the table cell with and img src tag
- Image array sample code
- Code From Nov 19
Place your code namedassign6.html
in your cpscsstorage02 assign 6 folder
Make sure you place any images the page uses in the assign 6 folder.