-
Inchworm
The code loads up an empty drop-down select with the numbers 2 through 10. Next, when a user uses a drop-down select
to choose a number between 2 and 10, an inchworm is created from the head and segment images
InchwormHead.gif and
InchwormSegment.gif.
The height of the image varies such that each consecutive image is 90% of the previous one.
-
Old Loop Lab
-
Pi series
Have the user enter the number of terms they would like summed in the series for Pi.
-
Timer
The Start button starts a timer that changes the display by 0.01 every 100th of a second. The
Start button is hidden and the Stop button shown (or one could simply change the text value of the
button). The Stop button stops the timer and the display freezes at that point. The Stop button
is then hidden and the Start button displayed. The Stop button also enables the Clear button. The
Clear button sets the display back to 000.00.
-
Snoopy Skater
Use a timer to have Snoopy skate to the right. Set the image's style's position to "absolute" and change the
left style property in the function called by the timer. In the document ready method, find the width of the
page. When Snoopy's left goes beyond the width you found, switch the src attribute to the second image and
start decreasing the left. Uses snoopy2.gif and
snoopy2a.gif
-
NeckerCube
Two similar images have their style's position set to "absolute" and are given the same
left and top values but different z-index values so that one is on top of the other. A timer
changes the opacity of the top image from 1 down to 0 and back again in a cycle.
Uses NeckerCube_700_A.gif,
NeckerCube_700_B.gif
and steel-mesh.jpg
Solutions