1 / 6

Reminder

Reminder. Lab 6, due Wed, 10pm Lab 7/8 both due next Mon (May 9). Tips on Lab 7. To make the image of hands in the center, add the following CSS code between the <style> tags (You need a pair of p tags around the img tag to make it work): p {text-align:center;}

caia
Download Presentation

Reminder

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Reminder • Lab 6, due Wed, 10pm • Lab 7/8 both due next Mon (May 9)

  2. Tips on Lab 7 • To make the image of hands in the center, add the following CSS code between the <style> tags (You need a pair of p tags around the img tag to make it work): p {text-align:center;} • If Error Console thinks this is wrong: “display( ‘ let” + letter + “.jpg ‘)” Use the following instead: “display( &apos; let” + letter + “.jpg &apos; )” &apos; is the ASCII code for single quote

  3. Tips on Lab 7 (cont.) • In Part 2 of Lab 7, when you call spell() with your name, use CAPITALIZED letters and don’t forget “*”. For example, mine will be: onclick="spell(‘YUAN*’, 500)"

  4. Tips on Lab 8 • Please finish Week 6 reading before you do this lab. • Figure out what goes where. The declaration of variables and functions should go between <script></script> at the head section. The JS codes for onclick event, such as calling a function and changing the value of a variable, go to onclick=“…” inside the button input tag.

  5. Tips on Lab 8 (cont.) • There are two typical ways to assign the value of the text box to the variable text. Assume the input tag for the text box is <input type=“text” name=“boxName” id=“boxID” value=“” /> • Use name(see textbook P.592) text = document.forms[0].boxName.value; • Use id text = document.getElementById(“boxID").value;

  6. Tips on Lab 8 (cont.) • Sketch of the new spell function (overwrite the old one) function spell (){ varoneLet; text = text.toUpperCase(); for(var j=0; j<text.length; i++){ oneLet = text.slice(j, j+1) ; if (oneLet==“J”){ //show the letter “J” with four images; use elapsed + 250 as time } else if(oneLet==“Z”){ //show the letter “Z” with four images; use elapsed + 250 as time } else{ //show oneLet; use elapsed + 250 as time } //end of the if-else statement } //end of the for loop //show the image of folded hands; use elapsed + 1000 as time } //end of the spell function

More Related