Начало
Разное
Застенчивая Кнопка
Попытайтесь щелкнуть неправильным ответом с этим умным подлинником
Is the JavaScript Source the best place to find JavaScripts?
JavaScript Miscellaneous: Застенчивая Кнопка
<!-- TWO STEPS TO INSTALL SHY BUTTON: 1. Copy the coding into the HEAD of your HTML document 2. Add the last code into the BODY of your HTML document --> <!-- STEP ONE: Paste this code into the HEAD of your HTML document --> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <! > <! > <!-- Begin var flag = 1; function t() { if(flag == 1) { N.style.top = "75px"; N.style.left = "700px"; } if(flag == 2) { N.style.top = "115px"; N.style.left = "100px"; } if(flag == 3) { N.style.top = "300px"; N.style.left = "350px"; } flag = flag + 1; if(flag == 4) { flag = 1; } } function al() { alert("Correct!"); } // End --> </script> </HEAD> <!-- STEP TWO: Copy this code into the BODY of your HTML document --> <BODY> <center> Is the JavaScript Source the best place to find JavaScripts? </center> <DIV ID="N" STYLE="position:absolute; left:350px; top:300px; width:50px; height:50px;"> <form> <input type=button value="NO" onMouseover="t()"> </form> </DIV> <DIV ID="Y" STYLE="position:absolute; left:300px; top:300px; width:50px; height:50px;"> <form> <input type=button value="YES" onClick="al()"> </form> </DIV> <!-- Script Size: 1.42 KB -->