Friday, 19-Apr-2024, 4:57 AM


Main
Sign Up
Login
Wains Organization Welcome Guest | RSS  
Menu

Section categories
Javascripts [45]
Awesome javascripts codes..
HTML scripts [21]
HTML scripts you never seen before...

Information


Please Login Or Register to see all info
Name : Guest
Username : Guest
IP Address : 3.14.70.203
Group : Guests
Browser :

<..........................>
Current date : 19-Apr-2024
Current day : Friday

Get Updates

New Downloads
[ Games/Torrents ]
[ Games/Torrents ]
[ Softwares ]
demo image         
jQuery Book - 1.2-V1 (0)
[ Games/Torrents ]

Statistics

Total online: 1
Guests: 1
Users: 0

Main » Articles » Javascripts

Stars moving in background
Code

<!-- this script got from www.wainsorg.ucoz.com-->
  <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>

<font face="Tahoma"><a target="_blank" href="http://www.wainsorg.ucoz.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>

Preview :
Preview is not available..
Category: Javascripts | Added by: Alex (08-Mar-2013) | Author: Ali Ameen Wains E W
Views: 972 | Tags: Stars moving in background, Codes, javascript, by Ali Ameen Wains | Rating: 0.0/0
Total comments: 0
Only registered users can add comments.
[ Sign Up | Login ]
Search

Extras

Partners
Add your website

New Scripts
[ HTML scripts ]
[ Javascripts ]
[18-Apr-2013]
Random Link (0)
[ HTML scripts ]
[14-Mar-2013]
Alignments (0)
[ HTML scripts ]
[14-Mar-2013]
Table with Color effect (0)
[ HTML scripts ]
[14-Mar-2013]
Line Divider (1)

New Blogs
[ Custom Script ]
[ How? ]
[ How? ]
[ How? ]

Our poll
How would you rate your knowledge in uCoz?

Copyright Wains Org. © 2024Powered by uCoz / Customization by Ali Ameen Wains / About AdminPrivacy Policy