Scroll box flashy-thingy code
<html> <head> <title>Scroll box flashy-thingy</title> <script type="text/javascript"> var flashindex = 0; var flashdir = "down"; var flashstate = "off"; if (document.images) { smiley_ed = new Image(64,64); smiley_ed.src = "smiley_ed.gif"; smiley_rick = new Image(64,64); smiley_rick.src = "smiley_rick.gif"; smiley_tom = new Image(64,64); smiley_tom.src = "smiley_tom.gif"; smiley_guido = new Image(64,64); smiley_guido.src = "smiley_guido.gif"; flashpics = new Array(4); flashpics[0] = "smiley_ed"; flashpics[1] = "smiley_rick"; flashpics[2] = "smiley_tom"; flashpics[3] = "smiley_guido"; } function hiLite(imgObjName) { if (document.images) { document.images['flashpic'].src = eval(flashpics[imgObjName] + ".src"); } } function Flasher() { if(flashstate == "on") { window.document.flashform.flashbtn.style.color = "#008800"; window.document.flashform.flashbtn.value = "Start"; flashstate = "off"; } else { window.document.flashform.flashbtn.style.color = "#ee0000"; window.document.flashform.flashbtn.value = "Stop"; flashstate = "on"; FlashSelect(); } } function FlashSelect() { if(flashstate == "on") { window.document.flashform.flashfriend[flashindex].selected = true; hiLite(flashindex); setTimeout('FlashSelect2()',500); } } function FlashSelect2() { if (flashdir == "down") { flashindex++; if (flashindex == 4) { flashindex = 2; flashdir = "up"; } FlashSelect(); } else { flashindex--; if (flashindex == -1) { flashindex = 1; flashdir = "down"; } FlashSelect(); } } </script> </head> <body> <form name="flashform"> <table cellspacing="0" cellpadding="0"> <tr><td> <select name="flashfriend" size="4" style="width:75px;"> <option value="ed">Ed <option value="rick">Rick <option value="tom">Tom <option value="guido">Guido </select> </td><td> </td><td rowspan="2"> <img src="smiley_ed.gif" width="64" height="64" name="flashpic" alt=""> </td></tr> <tr><td colspan="2"> <input type="button" name="flashbtn" value="Start" onClick="Flasher();this.blur();" style="font:bold 11px verdana,sans-serif;color:#008800;width:75px;"> </td></tr> </table> </form> </body> </html>
Form Tutor |
Lessons: Intro 1 2 3 4 5 6 7 8 9 10 11 12 13 Quick Forms Reference |
HTML 4.0 Reference Barebones HTML Guide |
![]() |