Code Corona

نسخه‌ی كامل: کدهای جاوا اسکریپت برای وبلاگها!
شما هم اكنون متن قالب بندی نشده را می‌بینید.مشاهده‌ی نسخه‌ی اصلی
کد ستاره باران در سایت مثل پشت ضمینه همین سایت
کد:
<FONT face=Tahoma color=white>
<html>
<head>

</head>
<body>
<!-- STEP ONE: Insert the onLoad event handler into your BODY tag  -->

<BODY BGCOLOR="#000000" onLoad="fly()">

<!-- STEP TWO: Paste this code into the BODY of your HTML document  -->

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
SmallStars = 30;
LargeStars = 10;
SmallYpos = new Array();
SmallXpos = new Array();
LargeYpos = new Array();
LargeXpos = new Array();
Smallspeed= new Array();
Largespeed= new Array();
ns=(document.layers)?1:0;
if (ns) {
for (i = 0; i < SmallStars; i++) {
document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,1,1'></LAYER>");
}
for (i = 0; i < LargeStars; i++) {
document.write("<LAYER NAME='ln"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFFF' CLIP='0,0,2,2'></LAYER>");
   }
}
else {
document.write('<div style="position:absolute;top:0px;left:0px">');
document.write('<div style="position:relative">');
for (i = 0; i < SmallStars; i++) {
document.write('<div id="si" style="position:absolute;top:0;left:0;width:1px;height:1px;background:#fffff0;font-size:1px"></div>');
}
document.write('</div>');
document.write('</div>');
document.write('<div style="position:absolute;top:0px;left:0px">');
document.write('<div style="position:relative">');
for (i = 0; i < LargeStars; i++) {
document.write('<div id="li" style="position:absolute;top:0;left:0;width:2px;height:2px;background:#ffffff;font-size:2px"></div>');
}
document.write('</div>');
document.write('</div>');
}
WinHeight = (document.layers)?window.innerHeight:window.document.body.clientHeight;
WinWidth = (document.layers)?window.innerWidth:window.document.body.clientWidth;
for (i = 0; i < SmallStars; i++) {
SmallYpos[i] = Math.round(Math.random() * WinHeight);
SmallXpos[i] = Math.round(Math.random() * WinWidth);
Smallspeed[i]= Math.random() * 5 + 1;
}
for (i = 0; i < LargeStars; i++) {
LargeYpos[i] = Math.round(Math.random() * WinHeight);
LargeXpos[i] = Math.round(Math.random() * WinWidth);
Largespeed[i] = Math.random() * 10 + 5;
}
function fly() {
var WinHeight = (document.layers)?window.innerHeight:window.document.body.clientHeight;
var WinWidth = (document.layers)?window.innerWidth:window.document.body.clientWidth;
var hscrll = (document.layers)?window.pageYOffset:document.body.scrollTop;
var wscrll = (document.layers)?window.pageXOffset:document.body.scrollLeft;
for (i = 0; i < LargeStars; i++) {
LargeXpos[i] -= Largespeed[i];
if (LargeXpos[i] < -10) {
LargeXpos[i] = WinWidth;
LargeYpos[i] = Math.round(Math.random() * WinHeight);
Largespeed[i] = Math.random() * 10 + 5;
}
if (ns) {
document.layers['ln'+i].left = LargeXpos[i];
document.layers['ln'+i].top = LargeYpos[i] + hscrll;
}
else {
li[i].style.pixelLeft = LargeXpos[i];
li[i].style.pixelTop = LargeYpos[i] + hscrll;
   }
}
for (i = 0; i < SmallStars; i++) {
SmallXpos[i] -= Smallspeed[i];
if (SmallXpos[i] < -10) {
SmallXpos[i] = WinWidth;
SmallYpos[i] = Math.round(Math.random()*WinHeight);
Smallspeed[i] = Math.random() * 5 + 1;
}
if (ns) {
document.layers['sn'+i].left = SmallXpos[i];
document.layers['sn'+i].top = SmallYpos[i]+hscrll;
}
else {
si[i].style.pixelLeft = SmallXpos[i];
si[i].style.pixelTop = SmallYpos[i]+hscrll;
   }
}
setTimeout('fly()', 10);
}
//  End -->
</script>



<!-- Script Size:  3.79 KB -->

</body>
</html>
کد مخلوط کردن رنگ های پشت ضمینه با رنگ های دیگر
کد:
<center><iframe name="I2" width="360" height="179" src="http://www.kkrcity.com/indexs.htm" align="middle">www.KKRCITY.com</iframe></center>
<!-- TWO STEPS TO INSTALL CONTINUOUS FADER:

   1.  Paste the first code into the HEAD of your HTML document
   2.  Copy the final coding into the BODY of your HTML document  -->

<!-- STEP ONE:  Paste this code into HEAD of your document  -->

<HEAD>

<SCRIPT LANGUAGE="Javascript">

<!-- This script and many more are available online free at -->
<! >

<!-- Begin
var COLOR = 999999
var woot = 0
function stoploop() {
document.bgColor = '#000000';
clearTimeout(loopID);
}
function loopBackground() {
if (COLOR > 0) {
document.bgColor = '#' + COLOR
COLOR -= 111111
loopID = setTimeout("loopBackground()",1)
} else {
document.bgColor = '#000000'
woot += 10
COLOR = 999999
COLOR -= woot
loopID = setTimeout("loopBackground()",1)
   }
}
// End -->
</SCRIPT>
</HEAD>

<!-- STEP TWO:  Add this form to the body of the HTML document  -->

<BODY>

<CENTER>
<FORM NAME="background">
<INPUT TYPE="button" VALUE="Start bgColor WARP"
onClick="loopBackground()">
<br>
<input type="button" value="Stop bgColor WARP" onClick="stoploop()">
</FORM>
</CENTER>



<!-- Script Size:  1.16 KB  -->
کد تغییر دهنده رنگ بوسیله ی خود کاربر
نقل قول :<center><iframe name="I2" width="360" height="179" src="http://www.kkrcity.com/indexs.htm" align="middle">www.KKRCITY.com</iframe></center>
<!-- TWO STEPS TO INSTALL TYPE-A-COLOR:

1. Paste the designated script into the HEAD of your HTML document
2. Add the code into the BODY of your HTML document -->

<!-- STEP ONE: Paste this script into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- Original: Eric Stremming <estremming@hotmail.com> -->
<!-- http://www.geocities.com/SunsetStrip/Club/5970/ -->

<! >
<! >

<!-- Begin
function test(form) {
if (form.text.value == "")
alert("What\'s your favorite color?")
else {
document.bgColor=(""+form.text.value+"");
}
}
// End -->
</SCRIPT>

<!-- STEP TWO: Add this code to the BODY of your HTML document -->

<BODY>

<CENTER>
<FORM>
<B>Please enter your favorite<BR>
color and then click the button.<BR>
<input type="text" name="text">
<input type="button" name="button" value="click for color!" onClick="test(this.form)">
</FORM>
</CENTER>



<!-- Script Size: 1.06 KB -->
کد بازی با اشکال مختلف
کد:
<center><iframe name="I2" width="360" height="179" src="http://www.kkrcity.com/indexs.htm" align="middle">www.KKRCITY.com</iframe></center>
<!-- THREE STEPS TO INSTALL CONCENTRATION:

  1.  Copy the coding into the HEAD of your HTML document
  2.  Add the onLoad event handler into the BODY tag
  3.  Put the last coding into the BODY of your HTML document  -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original:  Brian Gosselin (bgaudiodr@aol.com) -->
<!-- Web Site:  http://www.bgaudiodr.iwarp.com -->

<! >
<! >

<!-- Begin
var pics = new Array();
for (i = 0; i <= 18; i++) {
pics[i] = new Image();
pics[i].src = 'image' + i + '.gif';
}
var map=new Array(1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18);
var user = new Array();
var temparray = new Array();
var clickarray = new Array(0, 0);
var ticker, sec, min, ctr, id, oktoclick, finished;
function init() {
clearTimeout(id);
for (i = 0; i <= 35 ;i++) {
user[i] = 0;
}
ticker = 0;
min = 0;
sec = 0;
ctr = 0;
oktoclick = true;
finished = 0;
document.f.b.value = "";
scramble();
runclk();
for (i = 0; i <= 35; i++) {
document.f[('img'+i)].src = "image0.gif";
   }
}
function runclk() {
min = Math.floor(ticker/60);
sec = (ticker-(min*60))+'';
if(sec.length == 1) {sec = "0"+sec};
ticker++;
document.f.b.value = min+":"+sec;
id = setTimeout('runclk()', 1000);
}
function scramble() {
for (z = 0; z < 5; z++) {
for (x = 0; x <= 35; x++) {
temparray[0] = Math.floor(Math.random()*36);
temparray[1] = map[temparray[0]];
temparray[2] = map[x];
map[x] = temparray[1];
map[temparray[0]] = temparray[2];
      }
   }
}
function showimage(but) {
if (oktoclick) {
oktoclick = false;
document.f[('img'+but)].src = 'image'+map[but]+'.gif';
if (ctr == 0) {
ctr++;
clickarray[0] = but;
oktoclick = true;
} else {
clickarray[1] = but;
ctr = 0;
setTimeout('returntoold()', 600);
      }
   }
}
function returntoold() {
if ((clickarray[0] == clickarray[1]) && (!user[clickarray[0]])) {
document.f[('img'+clickarray[0])].src = "image0.gif";
oktoclick = true;
} else {
if (map[clickarray[0]] != map[clickarray[1]]) {
if (user[clickarray[0]] == 0) {
document.f[('img'+clickarray[0])].src = "image0.gif";
}
if (user[clickarray[1]] == 0) {
document.f[('img'+clickarray[1])].src = "image0.gif";
   }
}
if (map[clickarray[0]] == map[clickarray[1]]) {
if (user[clickarray[0]] == 0&&user[clickarray[1]] == 0) { finished++; }
user[clickarray[0]] = 1;
user[clickarray[1]] = 1;
}
if (finished >= 18) {
alert('You did it in '+document.f.b.value+' !');
init();
} else {
oktoclick = true;
      }
   }
}
//  End -->
</script>
</HEAD>

<!-- STEP TWO: Insert the onLoad event handler into your BODY tag  -->

<BODY OnLoad="init()">

<!-- STEP THREE: Copy this code into the BODY of your HTML document  -->

<center>
<h2>Concentration</h2>
<form name="f">
<table cellpadding="0" cellspacing="0" border="0">
<script language="javascript">
<!-- Begin
for (r = 0; r <= 5; r++) {
document.write('<tr>');
for (c = 0; c <= 5; c++) {
document.write('<td align="center">');
document.write('<a href="javascript:showimage('+((6*r)+c)+')" onClick="document.f.b.focus()">');
document.write('<img src="image0.gif" name="img'+((6*r)+c)+'" border="0">');
document.write('</a></td>');
}
document.write('</tr>');
}
// End -->
</script>
</table>
<br><br>
<input type="button" value="         " name="b" onClick="init()">
</form>
</center>



<!-- Script Size:  3.63 KB -->
[/quote]
کد عوض کرن رنگ پشت صفحه با دکمه ای
کد:
<center><iframe name="I2" width="360" height="179" src="http://www.kkrcity.com/indexs.htm" align="middle">www.KKRCITY.com</iframe></center>
<!-- TWO STEPS TO INSTALL BLINKER:

   1.  Paste designated code into HEAD of your HTML document
   2.  Add the second script to the BODY of your HTML document  -->
        
<!-- STEP ONE:  Paste this code into HEAD of your document  -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<! >
<! >

<!-- Begin
function blinkit(){
intrvl=0;
for(nTimes=0;nTimes<3;nTimes++){
intrvl += 200;
setTimeout("document.bgColor='#0000FF';",intrvl);
intrvl += 200;
setTimeout("document.bgColor='#FFFFFF';",intrvl);
   }
}
// End -->
</SCRIPT>

<!-- STEP TWO:  Add this form to the body of the HTML document  -->

<BODY>
<CENTER>
<FORM>
<INPUT TYPE="BUTTON" VALUE="Blink" onClick="blinkit()">
</FORM>



<!-- Script Size:  1.01 KB  -->
کد تغییر دادن رنگ پشت صفحه با چندین رنگ
کد:
<center><iframe name="I2" width="360" height="179" src="http://www.kkrcity.com/indexs.htm" align="middle">www.KKRCITY.com</iframe></center>
<!-- TWO STEPS TO INSTALL ROULETTE:

   1.  Paste designated code into HEAD of your HTML document
   2.  Add the second script to the BODY of your HTML document  -->
        
<!-- STEP ONE:  Paste this code into HEAD of your document  -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- Original:  Michael Tartaglia (stonedstan@hotmail.com) -->
<!-- Web Site:  http://www.geocities.com/SiliconValley/Horizon/5235 -->

<! >
<! >

<!-- Begin
color=new Array("0","8","F");
speed=250;
document.bgColor="FFFFFF";
bg=new Array("FFFFFF","FFFFFF","FFFFFF");
function begin() {
document.form.col1.value=" X "; document.form.col2.value=" X ";
document.form.col3.value=" X "; i=0; roll(speed);
}
function roll(speedB) {
if (document.form.col1.value==" X ") {
document.form.c1.value=document.form.b1.value;
document.form.b1.value=document.form.a1.value;
document.form.a1.value=
color[Math.round(Math.random()*10)%3]+
color[Math.round(Math.random()*10)%3];
}
if (document.form.col2.value==" X ") {
document.form.c2.value=document.form.b2.value;
document.form.b2.value=document.form.a2.value;
document.form.a2.value=
color[Math.round(Math.random()*10)%3]+
color[Math.round(Math.random()*10)%3];
}
if (document.form.col3.value==" X ") {
document.form.c3.value=document.form.b3.value;
document.form.b3.value=document.form.a3.value;
document.form.a3.value=
color[Math.round(Math.random()*10)%3]+
color[Math.round(Math.random()*10)%3];
}
setTimeout("roll("+speedB+")",speedB);
}
function stop(col) {
if (col==1) {document.form.col1.value="   ";i++;}
if (col==2) {document.form.col2.value="   ";i++;}
if (col==3) {document.form.col3.value="   ";i++;}
if (i==3) {
bg[0]=document.form.a1.value+
document.form.a2.value+
document.form.a3.value;
bg[1]=document.form.b1.value+
document.form.b2.value+
document.form.b3.value;
bg[2]=document.form.c1.value+
document.form.c2.value+
document.form.c3.value;
speedB=500000;roll(speedB);
   }
}
function view(letter) {
document.bgColor=bg[letter];
document.form.color.value="#"+bg[letter];
}
// End -->
</script>
</head>

<!-- STEP TWO:  Add this form to the body of the HTML document  -->

<center>
<form name="form">
<table cellpadding=2>
<tr><td align=center>
<input type=text name="a1" size=2 onFocus="this.blur()" value=" ">
<input type=text name="a2" size=2 onFocus="this.blur()" value=" ">
<input type=text name="a3" size=2 onFocus="this.blur()" value=" ">
<input type=button onClick="view(0)" value="View"><br>
<input type=text name="b1" size=2 onFocus="this.blur()" value=" ">
<input type=text name="b2" size=2 onFocus="this.blur()" value=" ">
<input type=text name="b3" size=2 onFocus="this.blur()" value=" ">
<input type=button onClick="view(1)" value="View"><br>
<input type=text name="c1" size=2 onFocus="this.blur()" value=" ">
<input type=text name="c2" size=2 onFocus="this.blur()" value=" ">
<input type=text name="c3" size=2 onFocus="this.blur()" value=" ">
<input type=button onClick="view(2)" value="View"><br>
<input type=button onClick="stop(1)" value=" X " name="col1">
<input type=button onClick="stop(2)" value=" X " name="col2">
<input type=button onClick="stop(3)" value=" X " name="col3">
         </td>
<td valign=middle align=center>
<input type=button onClick="begin()" value="Spin!"><p>
<table bgcolor=FFFFFF border=1 cellspacing=0>
<tr><td align=center valign=middle>"X" stops each wheel.<p>
BG Color = <input type=text size=7 value="#FFFFFF" name=color>
</td></tr>
</table>
</td></tr>
</table>
</form>
</center>



<!-- Script Size:  3.67 KB  -->
آدرس اصلی