[HTML] HALP

Status
Not open for further replies.

Avalkiz

Well-Known Member
Messages
3,001
Location
Poland
Code:
<script language="JavaScript1.2">
var snowsrc="http://67.228.194.3/~themaves/forums/Smileys/default/holmes3.gif"
var no = 15;

var ns4up = (document.layers) ? 1 : 0; 
var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;

var dx, xp, yp; 
var am, stx, sty; 
var i, doc_width = 800, doc_height = 600;

if (ns4up||ns6up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}

dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();

for (i = 0; i < no;    i) {
dx[i] = 0; // set coordinate variables
xp[i] = Math.random()*(doc_width-50); 
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20; 
stx[i] = 0.02   Math.random()/10; 
sty[i] = 0.7   Math.random(); 
if (ns4up) { 
if (i == 0) {
document.write("<layer name="dot"  i  "" left="15" top="15" visibility="show"><a href="http://dynamicdrive.com/"><img src='" snowsrc "' border="0"></a></layer>");
} else {
document.write("<layer name="dot"  i  "" left="15" top="15" visibility="show"><img src='" snowsrc "' border="0"></layer>");
}
} else if (ie4up||ns6up) {
if (i == 0) {
document.write("<div id="dot"  i  "" style="POSITION: absolute; Z-INDEX: "  i  "; VISIBILITY: visible; TOP: 15px; LEFT: 15px;"><a href="http://dynamicdrive.com"><img src='" snowsrc "' border="0"></a></div>");
} else {
document.write("<div id="dot"  i  "" style="POSITION: absolute; Z-INDEX: "  i  "; VISIBILITY: visible; TOP: 15px; LEFT: 15px;"><img src='" snowsrc "' border="0"></div>");
}
}
}

function snowNS() { 
for (i = 0; i < no;    i) { 
yp[i]  = sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02   Math.random()/10;
sty[i] = 0.7   Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
dx[i]  = stx[i];
document.layers["dot" i].top = yp[i];
document.layers["dot" i].left = xp[i]   am[i]*Math.sin(dx[i]);
}
setTimeout("snowNS()", 10);
}

function snowIE_NS6() { 
for (i = 0; i < no;    i) { 
yp[i]  = sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02   Math.random()/10;
sty[i] = 0.7   Math.random();
doc_width = ns6up?window.innerWidth : document.body.clientWidth;
doc_height = ns6up?window.innerHeight : document.body.clientHeight;
}
dx[i]  = stx[i];
if (ie4up){
document.all["dot" i].style.pixelTop = yp[i];
document.all["dot" i].style.pixelLeft = xp[i]   am[i]*Math.sin(dx[i]);
}
else if (ns6up){
document.getElementById("dot" i).style.top=yp[i];
document.getElementById("dot" i).style.left=xp[i]   am[i]*Math.sin(dx[i]);
}
}
setTimeout("snowIE_NS6()", 10);
}

if (ns4up) {
snowNS();
} else if (ie4up||ns6up) {
snowIE_NS6();
}

</script>


HALP HOW I CAN MAKE IT WORKING :huh: :huh: :huh: :huh: :huh: :huh: :huh: :huh: :huh: :huh:
 
Jeeze... I don't have a clue, I don't know much about javascript TBH :/
 
Could you test it for me :V

There is the source just to save in .js and put on ftp
Code:
var SNOW_Picture = "http://67.228.194.3/~themaves/forums/Smileys/default/holmes3.gif"
var SNOW_no = 15;

var SNOW_browser_IE_NS = (document.body.clientHeight) ? 1 : 0;
var SNOW_browser_MOZ = (self.innerWidth) ? 1 : 0;
var SNOW_browser_IE7 = (document.documentElement.clientHeight) ? 1 : 0;

var SNOW_Time;
var SNOW_dx, SNOW_xp, SNOW_yp;
var SNOW_am, SNOW_stx, SNOW_sty;
var i, SNOW_Browser_Width, SNOW_Browser_Height;

if (SNOW_browser_IE_NS)
{
	SNOW_Browser_Width = document.body.clientWidth;
	SNOW_Browser_Height = document.body.clientHeight;
}
else if (SNOW_browser_MOZ)
{
	SNOW_Browser_Width = self.innerWidth - 20;
	SNOW_Browser_Height = self.innerHeight;
}
else if (SNOW_browser_IE7)
{
	SNOW_Browser_Width = document.documentElement.clientWidth;
	SNOW_Browser_Height = document.documentElement.clientHeight;
}

SNOW_dx = new Array();
SNOW_xp = new Array();
SNOW_yp = new Array();
SNOW_am = new Array();
SNOW_stx = new Array();
SNOW_sty = new Array();

for (i = 0; i < SNOW_no;    i)
{
	SNOW_dx[i] = 0;
	SNOW_xp[i] = Math.random()*(SNOW_Browser_Width-50);
	SNOW_yp[i] = Math.random()*SNOW_Browser_Height;
	SNOW_am[i] = Math.random()*20;
	SNOW_stx[i] = 0.02   Math.random()/10;
	SNOW_sty[i] = 0.7   Math.random();
	if (i == 0) document.write("<div id="SNOW_flake"  i  "" style="position: absolute; z-index: "  i  "; visibility: visible; top: 15px; left: 15px;"><a href="http://themavesite.com" target="_blank"><img src="" SNOW_Picture "" border="0"></a></div>");
	else document.write("<div id="SNOW_flake"  i  "" style="position: absolute; z-index: "  i  "; visibility: visible; top: 15px; left: 15px;"><img src="" SNOW_Picture "" border="0"></div>");
}

function SNOW_Weather()
{

for (i = 0; i < SNOW_no;    i)
{
	SNOW_yp[i]  = SNOW_sty[i];

	if (SNOW_yp[i] > SNOW_Browser_Height-50)
	{
		SNOW_xp[i] = Math.random()*(SNOW_Browser_Width-SNOW_am[i]-30);
		SNOW_yp[i] = 0;
		SNOW_stx[i] = 0.02   Math.random()/10;
		SNOW_sty[i] = 0.7   Math.random();
	}

	SNOW_dx[i]  = SNOW_stx[i];

	document.getElementById("SNOW_flake" i).style.top=SNOW_yp[i] "px";
	document.getElementById("SNOW_flake" i).style.left=SNOW_xp[i]   SNOW_am[i]*Math.sin(SNOW_dx[i]) "px";
}

SNOW_Time = setTimeout("SNOW_Weather()", 10);

}

SNOW_Weather();

This is to put anywhere on .html page
Code:
<script type="text/javascript" src="http://BLABLA HERE GOES THE LINK TO .JS FILE"></script>
PLx gime the link to the .js file/page so I could use this stuff on my site too?
And PLZ add it somewhere on TMS so I can see if it works

It shud be snowing with :holmes:
 
Can I upload .js files to zezombia.com? D:
I'm too lazy to combine with localhosting I almost never use it and I dunt have any programs like this



EDIT:/
OKAI prob solved, it works :biggrin: Zez.com can host .js files :biggrin: ty
http://multiserwis.tnb.pl/news.php
Thanks for helping trying to help =P
 
I won't put boobs on my site's frontpage :O If zez wants, he can hack my .js file on zezombia.com. :O
 
Javascript...

Anyway starting to go a bit offtopic here, and his problem is solved, so LOCK
 
Status
Not open for further replies.
Back
Top Bottom