Начало
Игры
Волшебные 8 Шаров
Когда-либо играли с JavaScript 8 Шаров? Ну, вот является полностью функциональным
Волшебные 8 Шаров говорят...
Получите Другое Предсказание
Скачать
magic8.zip
изображение
JavaScript Games: Волшебные 8 Шаров
<!-- THREE STEPS TO INSTALL MAGIC 8 BALL: 1. Put the first code into the HEAD of your HTML document 2. Paste the final coding into the BODY of your HTML document 3. Save the 9 necessary images into your web directory --> <!-- STEP ONE: Copy this code into the HEAD of your HTML document --> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <! > <! > <!-- Begin var sec = 0 var imgsrc var output = "<BR>" function getsec() { var date = new Date() sec = date.getSeconds() } function getnum() { if (sec > 49) { sec = sec - 50 } else { if (sec > 39){ sec = sec - 40 } else { if (sec > 29){ sec = sec - 30 } else { if (sec > 19){ sec = sec - 20 } else { if (sec > 9){ sec = sec - 10 }}}}}} function display() { imgsrc = '<img src="magic8' + sec + '.gif">' output += imgsrc } function doit(){ getsec(); getnum(); display(); document.write(output); } // End --> </SCRIPT> <!-- STEP TWO: Copy this code into the BODY of your HTML document --> <BODY> <CENTER> The Magic 8 Ball says... <BR> <SCRIPT> doit(); </SCRIPT> <BR> <A HREF="magic8.html"><B>Get Another Prediction</B></A> </CENTER> <!-- STEP THREE: Copy the 9 following images into your web directory --> <!-- Point your browser at the following URLs, then save the images... --> <!-- ../img/magic8/0.gif --> <!-- ../img/magic8/2.gif --> <!-- ../img/magic8/3.gif --> <!-- ../img/magic8/4.gif --> <!-- ../img/magic8/5.gif --> <!-- ../img/magic8/6.gif --> <!-- ../img/magic8/7.gif --> <!-- ../img/magic8/8.gif --> <!-- ../img/magic8/9.gif --> </textarea><br></td></tr> </table> </form> <!-- Script Size: 2.07 KB -->