How to show how many visitors are online on your website
->
Here is how you can show how many visitors are online on your website.
Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website
Code:
<pre><!-- this script is from www.manycodes.com --></pre> <script src=http://fastonlineusers.com/online.php?d=www.mohager.co.sr></script> <font face="Tahoma"><a target="_blank" href="http://www.manycodes.com/category/java/javascript-codes/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>
How to put a calculator script on your website
Here is how you can put a calculator script on your website.
Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website
Code:
<!-- this script is from www.manycodes.com --> <!-- A Simple Calculator --> <!-- Instructions: Just put this script anywhere on your webpage between the body tags and you will have a calculator for your visitors! --> <!-- Script supplied with CoffeeCup HTML Editor --> <!-- www.coffeecup.com --> <CENTER> <FORM name="Keypad" action=""> <TABLE> <B> <TABLE border=2 width=50 height=60 cellpadding=1 cellspacing=5> <TR> <TD colspan=3 align=middle> <input name="ReadOut" type="Text" size=24 value="0" width=100%> </TD> <TD </TD> <TD> <input name="btnClear" type="Button" value=" C " onclick="Clear()"> </TD> <TD><input name="btnClearEntry" type="Button" value=" CE " onclick="ClearEntry()"> </TD> </TR> <TR> <TD> <input name="btnSeven" type="Button" value=" 7 " onclick="NumPressed(7)"> </TD> <TD> <input name="btnEight" type="Button" value=" 8 " onclick="NumPressed(8)"> </TD> <TD> <input name="btnNine" type="Button" value=" 9 " onclick="NumPressed(9)"> </TD> <TD> </TD> <TD> <input name="btnNeg" type="Button" value=" +/- " onclick="Neg()"> </TD> <TD> <input name="btnPercent" type="Button" value=" % " onclick="Percent()"> </TD> </TR> <TR> <TD> <input name="btnFour" type="Button" value=" 4 " onclick="NumPressed(4)"> </TD> <TD> <input name="btnFive" type="Button" value=" 5 " onclick="NumPressed(5)"> </TD> <TD> <input name="btnSix" type="Button" value=" 6 " onclick="NumPressed(6)"> </TD> <TD> </TD> <TD align=middle><input name="btnPlus" type="Button" value=" + " onclick="Operation('+')"> </TD> <TD align=middle><input name="btnMinus" type="Button" value=" - " onclick="Operation('-')"> </TD> </TR> <TR> <TD> <input name="btnOne" type="Button" value=" 1 " onclick="NumPressed(1)"> </TD> <TD> <input name="btnTwo" type="Button" value=" 2 " onclick="NumPressed(2)"> </TD> <TD> <input name="btnThree" type="Button" value=" 3 " onclick="NumPressed(3)"> </TD> <TD> </TD> <TD align=middle><input name="btnMultiply" type="Button" value=" * " onclick="Operation('*')"> </TD> <TD align=middle><input name="btnDivide" type="Button" value=" / " onclick="Operation('/')"> </TD> </TR> <TR> <TD> <input name="btnZero" type="Button" value=" 0 " onclick="NumPressed(0)"> </TD> <TD> <input name="btnDecimal" type="Button" value=" . " onclick="Decimal()"> </TD> <TD colspan=3> </TD> <TD> <input name="btnEquals" type="Button" value=" = " onclick="Operation('=')"> </TD> </TR> </TABLE> </TABLE> </B> </FORM> </CENTER> <font face="Verdana, Arial, Helvetica" size=2> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var FKeyPad = document.Keypad; var Accumulate = 0; var FlagNewNum = false; var PendingOp = ""; function NumPressed (Num) { if (FlagNewNum) { FKeyPad.ReadOut.value = Num; FlagNewNum = false; } else { if (FKeyPad.ReadOut.value == "0") FKeyPad.ReadOut.value = Num; else FKeyPad.ReadOut.value += Num; } } function Operation (Op) { var Readout = FKeyPad.ReadOut.value; if (FlagNewNum && PendingOp != "="); else { FlagNewNum = true; if ( '+' == PendingOp ) Accumulate += parseFloat(Readout); else if ( '-' == PendingOp ) Accumulate -= parseFloat(Readout); else if ( '/' == PendingOp ) Accumulate /= parseFloat(Readout); else if ( '*' == PendingOp ) Accumulate *= parseFloat(Readout); else Accumulate = parseFloat(Readout); FKeyPad.ReadOut.value = Accumulate; PendingOp = Op; } } function Decimal () { var curReadOut = FKeyPad.ReadOut.value; if (FlagNewNum) { curReadOut = "0."; FlagNewNum = false; } else { if (curReadOut.indexOf(".") == -1) curReadOut += "."; } FKeyPad.ReadOut.value = curReadOut; } function ClearEntry () { FKeyPad.ReadOut.value = "0"; FlagNewNum = true; } function Clear () { Accumulate = 0; PendingOp = ""; ClearEntry(); } function Neg () { FKeyPad.ReadOut.value = parseFloat(FKeyPad.ReadOut.value) * -1; } function Percent () { FKeyPad.ReadOut.value = (parseFloat(FKeyPad.ReadOut.value) / 100) * parseFloat(Accumulate); } // End --> </SCRIPT> <pre><font face="Tahoma"><a target="_blank" href="http://www.manycodes.com/category/java/javascript-codes/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font></pre>
How to allow your visitors to change the background colour of your website
Here is how you can change the background colour of your website. This will allow the user to change the background color of your page.
Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website
Code:
<!-- this script is from www.manycodes.com --> <!-- Start of Change BackGround Color--> <!-- DESCRIPTION: This will allow the user to change the background color of your page. Neat trick. INSTRUCTIONS: Place this script anywhere in the <BODY> tag. FUNCTIONALITY: Works in both Netscape and IE. --> <!-- //Modified by CoffeeCup Software //This code is Copyright (c) 1998 CoffeeCup Software //All rights reserved. License is granted to a single user to //reuse this code on a personal or business Web Site. // --> <CENTER> <FORM> <FONT FACE="VERDANA, ARIAL"><B>Choose a background color:</B></FONT> <SELECT name="ccGround" size="1" onChange=(document.bgColor=ccGround.options[ccGround.selectedIndex].value)> <OPTION value="408080" target="1" selected>Cool Green <OPTION value="C0C0C0" target="1">Cool Grey <OPTION value="000000" target="1">Black <OPTION value="730200" target="1">DarkRed <OPTION value="231800" target="1">Brown <OPTION value="044302" target="1">DarkGreen <OPTION value="0D09A3" target="1">Dark Blue <OPTION value="808040" target="1">Avocado <OPTION value="800080" target="1">Purple <OPTION value="444444" target="1">Gray <OPTION value="FF0400" target="1">Red <OPTION value="EFE800" target="1">Yellow <OPTION value="05EF00" target="1">Green <OPTION value="0206FF" target="1">Blue <OPTION value="AE08EF" target="1">Violet <OPTION value="FF8C8A" target="1">Mauve <OPTION value="FF80FF" target="1">Pink <OPTION value="FFCCCC" target="1">Peach <OPTION value="FFCC99" target="1">Orange <OPTION value="000080" target="1">Darker Blue <OPTION value="808080" target="1">Dark Grey <OPTION value="D5CCBB" target="1">Tan <OPTION value="DDDDDD" target="1">LightGray <OPTION value="FBFF73" target="1">Light Yellow <OPTION value="7CFF7D" target="1">LightGreen <OPTION value="A6BEFF" target="1">Light Blue <OPTION value="FFFFFF" target="1">White </SELECT></FORM></CENTER> <!-- Start of Change BackGround Color--> <pre><font face="Tahoma"><a target="_blank" href="http://www.manycodes.com/category/java/javascript-codes/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font></pre>
How to shake internet explorer window from your website
Here is how you can shake internet explorer window from your website.
Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website
Code:
<!-- this script is from www.manycodes.com --> <!-- START CODE Powered javascript code by WWW.javakhafan.7p.COM--> <meta http-equiv="Content-Language" content="en-us"> <SCRIPT language=JavaScript> <!-- Begin function shake(n) { if (parent.moveBy) { for (i = 10; i > 0; i--) { for (j = n; j > 0; j--) { parent.moveBy(-i,0); parent.moveBy(0,-i); parent.moveBy(-i,0); parent.moveBy(0,i); parent.moveBy(i,0); parent.moveBy(0,-i); parent.moveBy(-i,0); parent.moveBy(0,i); parent.moveBy(i,0); parent.moveBy(0,-i); parent.moveBy(-i,0); parent.moveBy(0,-i); parent.moveBy(i,0); parent.moveBy(0,i); parent.moveBy(i,0); parent.moveBy(0,i); } } } } // End --> <!-- shake(1); //--> </SCRIPT> <pre><font face="Tahoma"><a target="_blank" href="http://www.manycodes.com/category/java/javascript-codes/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font></pre>
How to put a text following mouse on your website
Here is how you can put a text following mouse on your website.
Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website
Code:
<!-- this script is from www.manycodes.com --> <!-- START OF Mouse Cursor Text Trailer DHTML --> <!-- SUMMARY BRIEF This DHTML script will make a text message follow your cursor around the screen. You can change the message to say whatever you want. You can change the font face, color and size in the .trailersytle tag below. You can change the message in the javascript below that. Just look for the comment that says "Insert your personal message below." --> <!-- Put this portion of the script inside of your <HEAD> tag --> <style> .trailerstyle { position: absolute; visibility: visible; top: -50px; font-size: 12px; font-family: Arial,Helvetica,Verdana; font-weight: bold; color: #000000; } </style> <script> <!-- var x,y var step=20 var flag=0 // Insert your personal message below. // Important: Do NOT remove the space at the end of the sentence!!! var message=" www.javascriptfreecode.com " message=message.split("") var xpos=new Array() for (i=0;i<=message.length-1;i++) { xpos[i]=-50 } var ypos=new Array() for (i=0;i<=message.length-1;i++) { ypos[i]=-50 } function handlerMM(e){ x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY flag=1 } function mousetrailer() { if (flag==1 && document.all) { for (i=message.length-1; i>=1; i--) { xpos[i]=xpos[i-1]+step ypos[i]=ypos[i-1] } xpos[0]=x+step ypos[0]=y for (i=0; i<message.length-1; i++) { var thisspan = eval("span"+(i)+".style") thisspan.posLeft=xpos[i] thisspan.posTop=ypos[i] } } else if (flag==1 && document.layers) { for (i=message.length-1; i>=1; i--) { xpos[i]=xpos[i-1]+step ypos[i]=ypos[i-1] } xpos[0]=x+step ypos[0]=y for (i=0; i<message.length-1; i++) { var thisspan = eval("document.span"+i) thisspan.left=xpos[i] thisspan.top=ypos[i] } } var timer=setTimeout("mousetrailer()",30) } //--> </script> <!-- Put this code inside of your <BODY> tag. --> <script> <!-- for (i=0;i<=message.length-1;i++) { document.write("<span id='span"+i+"' class='trailerstyle'>") document.write(message[i]) document.write("</span>") } if (document.layers){ document.captureEvents(Event.MOUSEMOVE); } document.onmousemove = handlerMM; //--> </script> <!-- Lastly, insert the following into the <BODY> tag, itself, just like the example that follows. --> <body onLoad="mousetrailer()" style="width:100%;overflow-x:hidden;overflow-y:scroll"> <!-- END OF Mouse Cursor Text Trailer DHTML --> <pre><font face="Tahoma"><a target="_blank" href="http://www.manycodes.com/category/java/javascript-codes/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font></pre>
How to put a clock on your website
Here is how you put a clock on your website.
Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website
Code:
<!-- this script is from www.manycodes.com --> <SCRIPT language=JavaScript> fCol='444444'; //face colour. sCol='FF0000'; //seconds colour. mCol='444444'; //minutes colour. hCol='444444'; //hours colour. Ybase=30; //Clock height. Xbase=30; //Clock width. H='...'; H=H.split(''); M='....'; M=M.split(''); S='.....'; S=S.split(''); NS4=(document.layers); NS6=(document.getElementById&&!document.all); IE4=(document.all); Ypos=0; Xpos=0; dots=12; Split=360/dots; if (NS6){ for (i=1; i < dots+1; i++){ document.write('<div id="n6Digits'+i+'" style="position:absolute;top:0px;left:0px;width:30px;height:30px;font-family:Arial;font-size:10px;color:#'+fCol+';text-align:center;padding-top:10px">'+i+'</div>'); } for (i=0; i < M.length; i++){ document.write('<div id="Ny'+i+'" style="position:absolute;top:0px;left:0px;width:2px;height:2px;font-size:2px;background:#'+mCol+'"></div>'); } for (i=0; i < H.length; i++){ document.write('<div id="Nz'+i+'" style="position:absolute;top:0px;left:0px;width:2px;height:2px;font-size:2px;background:#'+hCol+'"></div>'); } for (i=0; i < S.length; i++){ document.write('<div id="Nx'+i+'" style="position:absolute;top:0px;left:0px;width:2px;height:2px;font-size:2px;background:#'+sCol+'"></div>'); } } if (NS4){ dgts='1 2 3 4 5 6 7 8 9 10 11 12'; dgts=dgts.split(' ') for (i=0; i < dots; i++){ document.write('<layer name=nsDigits'+i+' top=0 left=0 height=30 width=30><center><font face=Arial size=1 color='+fCol+'>'+dgts[i]+'</font></center></layer>'); } for (i=0; i < M.length; i++){ document.write('<layer name=ny'+i+' top=0 left=0 bgcolor='+mCol+' clip="0,0,2,2"></layer>'); } for (i=0; i < H.length; i++){ document.write('<layer name=nz'+i+' top=0 left=0 bgcolor='+hCol+' clip="0,0,2,2"></layer>'); } for (i=0; i < S.length; i++){ document.write('<layer name=nx'+i+' top=0 left=0 bgcolor='+sCol+' clip="0,0,2,2"></layer>'); } } if (IE4){ document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=1; i < dots+1; i++){ document.write('<div id="ieDigits" style="position:absolute;top:0px;left:0px;width:30px;height:30px;font-family:Arial;font-size:10px;color:'+fCol+';text-align:center;padding-top:10px">'+i+'</div>'); } document.write('</div></div>') document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < M.length; i++){ document.write('<div id=y style="position:absolute;width:2px;height:2px;font-size:2px;background:'+mCol+'"></div>'); } document.write('</div></div>') document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < H.length; i++){ document.write('<div id=z style="position:absolute;width:2px;height:2px;font-size:2px;background:'+hCol+'"></div>'); } document.write('</div></div>') document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < S.length; i++){ document.write('<div id=x style="position:absolute;width:2px;height:2px;font-size:2px;background:'+sCol+'"></div>'); } document.write('</div></div>') } function clock(){ time = new Date (); secs = time.getSeconds(); sec = -1.57 + Math.PI * secs/30; mins = time.getMinutes(); min = -1.57 + Math.PI * mins/30; hr = time.getHours(); hrs = -1.57 + Math.PI * hr/6 + Math.PI*parseInt(time.getMinutes())/360; if (NS6){ Ypos=window.pageYOffset+window.innerHeight-Ybase-25; Xpos=window.pageXOffset+window.innerWidth-Xbase-30; for (i=1; i < dots+1; i++){ document.getElementById("n6Digits"+i).style.top=Ypos-15+Ybase*Math.sin(-1.56 +i *Split*Math.PI/180) document.getElementById("n6Digits"+i).style.left=Xpos-15+Xbase*Math.cos(-1.56 +i*Split*Math.PI/180) } for (i=0; i < S.length; i++){ document.getElementById("Nx"+i).style.top=Ypos+i*Ybase/4.1*Math.sin(sec); document.getElementById("Nx"+i).style.left=Xpos+i*Xbase/4.1*Math.cos(sec); } for (i=0; i < M.length; i++){ document.getElementById("Ny"+i).style.top=Ypos+i*Ybase/4.1*Math.sin(min); document.getElementById("Ny"+i).style.left=Xpos+i*Xbase/4.1*Math.cos(min); } for (i=0; i < H.length; i++){ document.getElementById("Nz"+i).style.top=Ypos+i*Ybase/4.1*Math.sin(hrs); document.getElementById("Nz"+i).style.left=Xpos+i*Xbase/4.1*Math.cos(hrs); } } if (NS4){ Ypos=window.pageYOffset+window.innerHeight-Ybase-20; Xpos=window.pageXOffset+window.innerWidth-Xbase-30; for (i=0; i < dots; ++i){ document.layers["nsDigits"+i].top=Ypos-5+Ybase*Math.sin(-1.045 +i*Split*Math.PI/180) document.layers["nsDigits"+i].left=Xpos-15+Xbase*Math.cos(-1.045 +i*Split*Math.PI/180) } for (i=0; i < S.length; i++){ document.layers["nx"+i].top=Ypos+i*Ybase/4.1*Math.sin(sec); document.layers["nx"+i].left=Xpos+i*Xbase/4.1*Math.cos(sec); } for (i=0; i < M.length; i++){ document.layers["ny"+i].top=Ypos+i*Ybase/4.1*Math.sin(min); document.layers["ny"+i].left=Xpos+i*Xbase/4.1*Math.cos(min); } for (i=0; i < H.length; i++){ document.layers["nz"+i].top=Ypos+i*Ybase/4.1*Math.sin(hrs); document.layers["nz"+i].left=Xpos+i*Xbase/4.1*Math.cos(hrs); } } if (IE4){ Ypos=document.body.scrollTop+window.document.body.clientHeight-Ybase-20; Xpos=document.body.scrollLeft+window.document.body.clientWidth-Xbase-20; for (i=0; i < dots; ++i){ ieDigits[i].style.pixelTop=Ypos-15+Ybase*Math.sin(-1.045 +i *Split*Math.PI/180) ieDigits[i].style.pixelLeft=Xpos-15+Xbase*Math.cos(-1.045 +i *Split*Math.PI/180) } for (i=0; i < S.length; i++){ x[i].style.pixelTop =Ypos+i*Ybase/4.1*Math.sin(sec); x[i].style.pixelLeft=Xpos+i*Xbase/4.1*Math.cos(sec); } for (i=0; i < M.length; i++){ y[i].style.pixelTop =Ypos+i*Ybase/4.1*Math.sin(min); y[i].style.pixelLeft=Xpos+i*Xbase/4.1*Math.cos(min); } for (i=0; i < H.length; i++){ z[i].style.pixelTop =Ypos+i*Ybase/4.1*Math.sin(hrs); z[i].style.pixelLeft=Xpos+i*Xbase/4.1*Math.cos(hrs); } } setTimeout('clock()',100); } clock(); //--> </SCRIPT> <SCRIPT language=JavaScript> fCol='444444'; //face colour. sCol='FF0000'; //seconds colour. mCol='444444'; //minutes colour. hCol='444444'; //hours colour. Ybase=30; //Clock height. Xbase=30; //Clock width. </body> <font face="Tahoma"><a target="_blank" href="http://www.manycodes.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>