School Map:  Home / Enroll $ Student Records; Class  
$ News @ LIVE Tech Radio * Support/FAQ | Store | FORUMS

Class / Forums / javascript101 Refresh the current page Post your Week #5 ADVANCED TO-DO ASSIGNMENT here
 

 (#46 2003-01-14 06:41:59) Post Reply

TDavid
php mySQL Perl C/C++
Principal


Enrolled: Mar 2000
Posts: 193
AP: 1

Your Week #5 ADVANCED TO-DO assignment should be posted here in this thread only. If you have specific questions about the week 1 course text then please also post them in this thread so that other students can learn from the information.

You can earn *up to 25* Script School activity points for turning in your ADVANCED to-do assignment. Your advanced to-do assignment will be graded on such things as completeness, attention to detail, creativity, originality, ingenuity and effort.

Here is the details on what you need to do for this assignment:

Use Arrays to hold a series of image links. Create a 'slide show' that shows a new image every 5 seconds.
Show different sets of images, which are adjusted for Gamma, according to their platform - Windows or Apple.
(Images are much 'brighter' on Apples)

 

 (#53 2003-02-04 11:32:34) Post Reply

wal
Need To Set


Enrolled: Jan 2003
Posts: 10
AP: 1

Here's my last assignment:

http://www.wal1.com/jschool/slideshow.htm

The source is below:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>
Untitled
</TITLE>
<SCRIPT
TYPE="text/javascript"
LANGUAGE="JavaScript">
<!--
// We assume that Apples are identified by the platform string containing "Apple".
var uPlatform=navigator.platform;
var isApple = false;
if (uPlatform.indexOf("Apple") >= 0)
{
isApple = true;
}

/* We create 2 arrays of image names: one for Apple
and one for everything else (Win32, Unix, WebTV, OS/2, Playstation, ...).
*/
var imageLinks=new Array("thnMartini.jpg","thnSpiral1.jpg",
"thnWorm.jpg","thnWorm2.jpg");
var AimageLinks=new Array("thnMartiniA.jpg","thnSpiral1A.jpg",
"thnWormA.jpg","thnWorm2A.jpg");
/* We create one array of images appropriate to the platform.
*/
var imageArray=new Array();
var counter;
for(counter=0; counter < imageLinks.length; counter++){
imageArray[counter]=new Image();
if (isApple) {
imageArray[counter].src=AimageLinks[counter];
}
else {
imageArray[counter].src=imageLinks[counter];
}
}
counter = 0;
/* This function is called once every 5 seconds to rotate images.
*/
function imageSwap() {
document.slide.src=imageArray[counter].src;
if (++counter == imageArray.length) {
counter = 0;
}
}
// This sets the interval (5 seconds).
window.setInterval( "imageSwap()", 5000 );
// -->
</SCRIPT>
</HEAD>
<BODY Onload="imageSwap()">
<CENTER>
<IMG
SRC="nothing.jpg"
ALT="Slide Show"
width="128"
height="96"
BORDER="0"
NAME="slide">
</CENTER>
</BODY>
</HTML>

 

 (#54 2003-02-07 19:23:51) Post Reply

logspirit
Need To Set


Enrolled: Oct 2001
Posts: 63
AP: 1

Very nicely done, very logical, quick code!!! Thanks for participating in the class!!! As soon as the Activity Points thing is fixed, You will get quite a few to trade in for books, etc at the end of the year!!! Happy coding!
I hope sometime You will be able to make it into the live chat room on Fridays (2:00 PM pacific time) and get to know some of the other folks at script school!!! www.scriptschool.com/radio && www.scriptschool.com/commons (for a Java chat client) It took me a long time before I realized that a large portion of what goes on at scriptschool takes place in the weekly live radio show and the chat room... 2 hours of fun and madness!!! Meet other programmers and webmasters, discuss work, and share current news that affects the computer world... I guess You did mention that You've checked out the archives... Hope You can make a live show sometime && perhaps call in... I would be very glad if the other folks have a chance to pick up some of Your 'smarts'... (not that they're 'dumb' or anything - but I think they would really benefit from hearing from a serious 'student')
Thanks Again
- logspirit -

 

 

View Previous Thread
Print this page Print This Page

View Next Thread

School Map:  Home / Enroll $ Student Records; Class  
$ News @ LIVE Tech Radio * Support/FAQ | Store

Advertising | Link To Us | Privacy 
Copyright 2000-2002 Script School Productions / KMR Enterprises 
No part of this website may be reproduced, copied and/or distributed in any medium 
without express written permission