Weeks 5  - 7 --Scripting images (conditionals, string handling, DOM)


document.images and document.forms

Note: Due date on Assignment #3 postponed until Wednesday, February, 21.


Javascript: events, forms, simple rollovers

rollovers and image event handling

text inputs in forms

Arrays of images & the document.images[] array

string handling : many techniques inclucing indexOf and charAt.

arrayplay (updated) 

more on associative arrays

Discussion of Assignment #4

Rotating clockwise The thing I played with in class on Wednesday


Assignment #4: Due Friday, March 2nd

Use Photoshop  or comparable software to draw

a) a face
or
b) a tree tree1.jpg (6218 bytes)

Your drawing should each be exactly 600 pixels wide by 400 pixels high, and stored in .jpg format. Make the picture as realistic as you can (within the time allotted). Slice the image into four pieces, each 300 by 200 pixels. Create a 2 by 2 table containing all four pieces (in some predefined, but scrambled order). Whenever someone clicks on one of the pictures, swap the position of it with the image next to it in a clockwise direction. Whenever the picture is reassembled (i.e., all four pieces are in their proper positions) then pop-up an alert message. Put the table on a web page in your class space and e-mail me the address (http://webclass.sru.edu/cpsc217/... et cetera).


Links that might be worth looking at:

slicing in Photoshop

Stuff from class

link1,

link2, (extra credit if you get this working in browsers other than IE)

link3 (extra credit if you get the button to include the image in all 5 browsers)

link4 and link5


 document.write and innerHTML and appendChild( )

New topics (week 7):

multDOM (a beginning) and buildDOM

windows, location and frames

Appending and removing rows of a table

Take a look at this goofy thing


Quiz #1 :  Friday March 9th.

Assignment #5 - Friday, March 23rd

Make a page containing two inputs (m and n) and three buttons. Whenever any button is pressed, construct an m by n multiplication table (illustration below). One button should use document.write, another: innerHTML, and the third should use the DOM methods (createElement, appendChild, etc.)

multiplication table

Make it look as much like the above as you can! (more to be said in class)


Extra Credit -- Intermediate JavaScript

Make the table,  written above, have certain errors or noise in the table. Specifically,  let the probability of an incorrect entry in the table be .15. Furthermore let the incorrect answers be plausible by letting each lie within 10% of the correct answer. Let a timer count the seconds as the user attempts to click on each of the incorrect answers. Each time an incorrect answer is correctly identified by the user, let its value be changed to the correct value and its background color changed to light green. Each time a correct answer is incorrectly clicked on by the user, change its background color to light yellow. When the user finishes identifying all incorrect answers in the table, produce a report letting them know how long it took to finish the task, as well as how many correct and incorrect clicks they made.

About time