PDA

View Full Version : Helpful JavaScripts to develop website



JavaScriptBank
11-17-2010, 10:35 PM
Helpful JavaScripts to develop website

Smash a Smiley 1.2

Similar to the free JavaScript game Whack the Gopher (http://www.javascriptbank.com/whack-the-gopher-index.html), this JavaScript game is simpler by change the picture of gophers into the ... detail (http://www.javascriptbank.com/smash-a-smiley-1-2.html/en//) at JavaScriptBank.com - 2.000+ free JavaScript codes (http://www.javascriptbank.com/)


http://www.javascriptbank.com/javascript.images/game/smash-a-smiley-1-2.jpg (http://www.javascriptbank.com/javascript/game/smash-a-smiley-1-2/preview/en/)
Demo: JavaScript Smash a Smiley 1.2 (http://www.javascriptbank.com/smash-a-smiley-1-2.html/en/)


How to setup

Step 1: Place JavaScript below in your HEAD section
JavaScript

<script language="Javascript">
/*
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
*/
<!--
/*
SMASH a SMILEY 1.2
---------------------------------------------------------------------
Copyright 1997 Tomas Lilje
http://home3.swipnet.se/~w-39426 || e.lilje@swipnet.se
Use this script if you want but don´t put
away this clip, and please drop me
a note. Email comments etc. too
*/

function eraone () {
document.play.first.value="";
}

function eratwo () {
document.play.second.value="";
}

function erathree () {
document.play.third.value="";
}

function erafour () {
document.play.fourth.value="";
}

function erafive () {
document.play.fifth.value="";
}

function erasix () {
document.play.sixth.value="";
}

function eraseven () {
document.play.seventh.value="";
}

function eraeight () {
document.play.eighth.value="";
}

function eranine () {
document.play.ninth.value="";
}

function start () {
document.play.fourth.value=" :-)";
document.play.third.value=" ;-o";
setTimeout("nextone ()",500);
}

function nextone () {
document.play.fourth.value="";
document.play.fifth.value="d:-D";
setTimeout("nexttwo ()",400);
}

function nexttwo () {
document.play.third.value="";
setTimeout("nextthree()",400);
}

function nextthree () {
document.play.seventh.value=":-(";
document.play.first.value=">:-)";
document.play.sixth.value="B-)";
setTimeout("nextfour ()",700);
}

function nextfour () {
document.play.first.value="";
document.play.sixth.value="";
document.play.second.value="=)";
setTimeout("nextfive ()",700);
}

function nextfive () {
document.play.seventh.value="";
document.play.second.value="";
document.play.fourth.value="[:o]";
setTimeout("nextsix ()",800);
}

function nextsix () {
document.play.eighth.value="d:-(";
document.play.second.value=">:-D";
setTimeout("nextseven ()",700);
}

function nextseven () {
document.play.eighth.value="";
document.play.fifth.value=":-)";
setTimeout("nexteight ()",400);
}

function nexteight () {
document.play.ninth.value=";-)"
document.play.fourth.value=":<0";
setTimeout("nextnine ()",500);
}

function nextnine () {
document.play.fifth.value="";
document.play.fourth.value="";
document.play.first.value=":-v";
setTimeout("nextten ()",200);
}

function nextten () {
document.play.third.value="B-)";
document.play.sixth.value=":-(";
setTimeout("nexteleven ()",600);
}

function nexteleven () {
document.play.first.value="";
document.play.seventh.value=";-(";
setTimeout("nexttwelve ()",500);
}

function nexttwelve () {
document.play.second.value="B-o";
document.play.ninth.value=";-(";
setTimeout("nextthirteen ()",700);
}

function nextthirteen () {
document.play.first.value=":-)";
document.play.ninth.value="";
document.play.seventh.value="";
setTimeout("start ()",600);
}

function stop () {
document.play.first.value="";
document.play.second.value="";
document.play.third.value="";
document.play.fourth.value="";
document.play.fifth.value="";
document.play.sixth.value="";
document.play.seventh.value="";
document.play.eighth.value="";
document.play.ninth.value="";
}

function about() {
alert("Smash a Smiley 1.2 is written by Tomas Lilje. You can use this game if you want, but don´t modify it, and please drop me a note. For further versions, please visit TNeT. Email-> e.lilje@swipnet.se TNeT-> http://home3.swipnet.se/~w-39426");
}

function help() {
alert("How to play: Your mission is to hit the smileys, when they show up. ");
}
//-->

</script>

Step 2: Copy & Paste HTML code below in your BODY section
HTML

<!--
/*
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
*/
-->
<table border=8 bgcolor="midnightblue" cellpadding=0 cellspacing=0>
<tr>
<td>
<form name="play">
<center>
<font face="Arial" color="FANTASY" size="4">
<b>Smash a Smiley 1.2
<hr>
<INPUT TYPE="button" NAME="first" OnClick="eraone ()" value=" ">

<INPUT TYPE="button" NAME="second" OnClick="eratwo ()" value=" ">
<INPUT TYPE="button" NAME="third" OnClick="erathree ()" value=" ">
<br>
<INPUT TYPE="button" NAME="fourth" OnClick="erafour ()" value=" ">
<INPUT TYPE="button" NAME="fifth" OnClick="erafive ()" value=" ">
<INPUT TYPE="button" NAME="sixth" OnClick="erasix ()" value=" ">
<br>
<INPUT TYPE="button" NAME="seventh" OnClick="eraseven ()" value=" ">
<INPUT TYPE="button" NAME="eighth" OnClick="eraeight ()" value=" ">
<INPUT TYPE="button" NAME="ninth" OnClick="eranine ()" value=" ">
<br>
<hr>
<INPUT TYPE="button" NAME="startitup" OnClick="start ()" value=" Start ">
<input type="button" name="hbutton" value=" Help" onclick="help()">
<input type="button" name="abutton" value=" About" onclick="about()">
<br>
<hr>

<font size="2">Copyright 1997 Tomas Lilje
</form>
</td>
</tr>
</table>







AJAX news ticker (http://www.javascriptbank.com/rss-ajax-newsticker.html) - JavaScript Refresh Page (http://www.javascriptbank.com/refresh-page-automatic.html/en/) - JavaScript Unclosable Window (http://www.javascriptbank.com/blink.html)


The Site may provide, or third parties may provide, links to non-JavaScriptBank.com Internet World Wide Web sites or resources. Because JavaScriptBank.com has no control over such sites and resources, you acknowledge and agree that JavaScriptBank.com is not responsible for the availability of such external sites or resources, and does not endorse and is not responsible or liable for any content, advertising, products, or other materials on or available from such sites or resources. You further acknowledge and agree that JavaScriptBank.com shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods or services available on or through any such site or resource.