Java script codes
+3
tid
darylldelfin
Mr.Recnikk
7 posters
Page 1 of 1
Java script codes
Where do I add JavaScrip comes (like falling snow and all that)?
Mr.Recnikk- New Member
- Posts : 3
Reputation : 0
Language : Ancient Greek
Re: Java script codes
you can inject scripts thru widgets .. modules > forum widget managements
or onto the homepage message ..
even on the site desciription ..
or onto the homepage message ..
even on the site desciription ..
Re: Java script codes
Hmm, so where we can find Snow script, if we don't have access to FTP? Oh, and is it possible on IP.Board Style?
tid- Forumember
-
Posts : 115
Reputation : 0
Language : Polish, Lil bit English
Re: Java script codes
tid wrote:Hmm, so where we can find Snow script, if we don't have access to FTP? Oh, and is it possible on IP.Board Style?
Ok, here it is.
First, like he said inject it in a widget.
Open it and add this code.
- Code:
<script type="text/javascript">
/******************************************
* Snow Effect script- By Altan d.o.o. (http://www.altan.hr/snow/index.html)
* Visit Dynamic Drive DHTML code library (http://www.dynamicdrive.com/) for full source code
* Last updated Nov 9th, 05' by DD. This notice must stay intact for use
******************************************/
var snowsrc="http://i71.servimg.com/u/f71/12/41/10/67/snow10.gif"
var no = 10;
var hidesnowtime = 0;
var snowdistance = "windowheight";
var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
function iecompattest()
{
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
var dx, xp, yp;
var am, stx, sty;
var i, doc_width = 800, doc_height = 600;
if (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;
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 (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 snowIE_NS6()
{
doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;
doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")? iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;
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();
}
dx[i] += stx[i];
document.getElementById("dot"+i).style.top=yp[i]+"px";
document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px";
}
snowtimer=setTimeout("snowIE_NS6()", 10);
}
function hidesnow()
{
if (window.snowtimer) clearTimeout(snowtimer)
for (i=0; i<no; i++) document.getElementById("dot"+i).style.visibility="hidden"
}
if (ie4up||ns6up)
{
snowIE_NS6();
if (hidesnowtime>0)
setTimeout("hidesnow()", hidesnowtime*1000)
}
</script>
Re: Java script codes
Gunhack X wrote:tid wrote:Hmm, so where we can find Snow script, if we don't have access to FTP? Oh, and is it possible on IP.Board Style?
Ok, here it is.
First, like he said inject it in a widget.
Open it and add this code.
- Code:
/******************************************
* Snow Effect script- By Altan d.o.o. (http://www.altan.hr/snow/index.html)
* Visit Dynamic Drive DHTML code library (http://www.dynamicdrive.com/) for full source code
* Last updated Nov 9th, 05' by DD. This notice must stay intact for use
******************************************/
var snowsrc="http://i71.servimg.com/u/f71/12/41/10/67/snow10.gif"
var no = 10;
var hidesnowtime = 0;
var snowdistance = "windowheight";
var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
function iecompattest()
{
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
var dx, xp, yp;
var am, stx, sty;
var i, doc_width = 800, doc_height = 600;
if (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;
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 (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]"+snowsrc+"[/img]");
}
else
{
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\">[img]"+snowsrc+"[/img]");
}
}
}
function snowIE_NS6()
{
doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;
doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")? iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;
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();
}
dx[i] += stx[i];
document.getElementById("dot"+i).style.top=yp[i]+"px";
document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px";
}
snowtimer=setTimeout("snowIE_NS6()", 10);
}
function hidesnow()
{
if (window.snowtimer) clearTimeout(snowtimer)
for (i=0; i0)
setTimeout("hidesnow()", hidesnowtime*1000)
}
Hi Gunhack X,
Can you explain how to do this a bit more for me? Where would someone put the widget if they want the snow on their index page? Also, will the snow effect work on the entire page if it's only in a widget? Sorry for the stupid questions but this is all foreign to me.
Re: Java script codes
Hi Gunhack X,
I added the code to a widget on my index page, opened it and hid the widget, but it doesn't seem to work though.
I added the code to a widget on my index page, opened it and hid the widget, but it doesn't seem to work though.
Re: Java script codes
Well, let me test this code in a widget. I am using PHPBB2, so I will test this in my test forum PHPBB3.
Last edited by Gunhack X on November 29th 2008, 1:48 am; edited 2 times in total
Re: Java script codes
Gunhack X wrote:Well, let me test this code in a widget. I am using PHPBB2, so I will test this in my test forum PHPBB3.
Ok thanks, I'm using PhpBB3 myself too.
Re: Java script codes
Ok, I don't know how to implement it in a widget, but you can implement it in the Homepage Message.
See, how it works.
http://lamision.allgoo.us/index.htm
AP > Display > Generalities > Homepage Message
- Code:
<script type="text/javascript">
/******************************************
* Snow Effect script- By Altan d.o.o. (http://www.altan.hr/snow/index.html)
* Visit Dynamic Drive DHTML code library (http://www.dynamicdrive.com/) for full source code
* Last updated Nov 9th, 05' by DD. This notice must stay intact for use
******************************************/
var snowsrc="http://i71.servimg.com/u/f71/12/41/10/67/snow10.gif"
var no = 10;
var hidesnowtime = 0;
var snowdistance = "windowheight";
var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
function iecompattest()
{
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
var dx, xp, yp;
var am, stx, sty;
var i, doc_width = 800, doc_height = 600;
if (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;
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 (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 snowIE_NS6()
{
doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;
doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")? iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;
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();
}
dx[i] += stx[i];
document.getElementById("dot"+i).style.top=yp[i]+"px";
document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px";
}
snowtimer=setTimeout("snowIE_NS6()", 10);
}
function hidesnow()
{
if (window.snowtimer) clearTimeout(snowtimer)
for (i=0; i<no; i++) document.getElementById("dot"+i).style.visibility="hidden"
}
if (ie4up||ns6up)
{
snowIE_NS6();
if (hidesnowtime>0)
setTimeout("hidesnow()", hidesnowtime*1000)
}
</script>
See, how it works.
http://lamision.allgoo.us/index.htm
Re: Java script codes
Gunhack X wrote:Ok, I don't know how to implement it in a widget, but you can implement it in the Homepage Message.AP > Display > Generalities > Homepage Message
- Code:
/******************************************
* Snow Effect script- By Altan d.o.o. (http://www.altan.hr/snow/index.html)
* Visit Dynamic Drive DHTML code library (http://www.dynamicdrive.com/) for full source code
* Last updated Nov 9th, 05' by DD. This notice must stay intact for use
******************************************/
var snowsrc="http://i71.servimg.com/u/f71/12/41/10/67/snow10.gif"
var no = 10;
var hidesnowtime = 0;
var snowdistance = "windowheight";
var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
function iecompattest()
{
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
var dx, xp, yp;
var am, stx, sty;
var i, doc_width = 800, doc_height = 600;
if (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;
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 (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]"+snowsrc+"[/img]");
}
else
{
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\">[img]"+snowsrc+"[/img]");
}
}
}
function snowIE_NS6()
{
doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;
doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")? iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;
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();
}
dx[i] += stx[i];
document.getElementById("dot"+i).style.top=yp[i]+"px";
document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px";
}
snowtimer=setTimeout("snowIE_NS6()", 10);
}
function hidesnow()
{
if (window.snowtimer) clearTimeout(snowtimer)
for (i=0; i0)
setTimeout("hidesnow()", hidesnowtime*1000)
}
See, how it works.
http://lamision.allgoo.us/index.htm
Looks cool....awesome!

Re: Java script codes
Is this problem resolved?
Nessa- Energetic
-
Posts : 6203
Reputation : 128
Language : English
Re: Java script codes
Yes, Mrs. Nessa, but I have a question for you.
Are you that girl in the avatar?
Are you that girl in the avatar?
Re: Java script codes
OMG, that awesome! I've tried Hundreds scripts, but those scripts wasn't moving, wasn't Showing etc.
You're great, Gunhack X. I think, that someone need to add some workings scripts to Tips and Tricks Forum. Maybe you, Nessa?
1. Comments scripts (there are two, from Zinex).
2. This Snow script (from Gunhack X)
3. Pop-up Message (from Placehold)
etc. It could be nice, if someone make a topic with working scrips there.
Thanks, one more time
EDIT
You can change snow image. Just paste your image URL in line
If you can't find that line, take a look at spoiler.
You're great, Gunhack X. I think, that someone need to add some workings scripts to Tips and Tricks Forum. Maybe you, Nessa?
1. Comments scripts (there are two, from Zinex).
2. This Snow script (from Gunhack X)
3. Pop-up Message (from Placehold)
etc. It could be nice, if someone make a topic with working scrips there.
Thanks, one more time

EDIT
You can change snow image. Just paste your image URL in line
var snowsrc="https://i.servimg.com/u/f71/12/41/10/67/snow10.gif"
If you can't find that line, take a look at spoiler.
- Spoiler:
- <script type="text/javascript">
/******************************************
* Snow Effect script- By Altan d.o.o. (http://www.altan.hr/snow/index.html)
* Visit Dynamic Drive DHTML code library (http://www.dynamicdrive.com/) for full source code
* Last updated Nov 9th, 05' by DD. This notice must stay intact for use
******************************************/
var snowsrc="https://i.servimg.com/u/f71/12/41/10/67/snow10.gif"
var no = 10;
var hidesnowtime = 0;
var snowdistance = "windowheight";
var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
function iecompattest()
{
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
var dx, xp, yp;
var am, stx, sty;
var i, doc_width = 800, doc_height = 600;
if (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;
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 (ie4up||ns6up)
{
if (i == 0)
{
document.write(" }
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 snowIE_NS6()
{
doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;
doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")? iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;
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();
}
dx[i] += stx[i];
document.getElementById("dot"+i).style.top=yp[i]+"px";
document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px";
}
snowtimer=setTimeout("snowIE_NS6()", 10);
}
function hidesnow()
{
if (window.snowtimer) clearTimeout(snowtimer)
for (i=0; i<no; i++) document.getElementById("dot"+i).style.visibility="hidden"
}
if (ie4up||ns6up)
{
snowIE_NS6();
if (hidesnowtime>0)
setTimeout("hidesnow()", hidesnowtime*1000)
}
</script>
tid- Forumember
-
Posts : 115
Reputation : 0
Language : Polish, Lil bit English
Re: Java script codes
One question:
For me that script works too, but not in portal:
There I tried that javascript and it didnt work either
Pls help me!
For me that script works too, but not in portal:
There I tried that javascript and it didnt work either

Pls help me!
- Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<html>
<head>
<script type="text/javascript" language="JavaScript">
<!--
var Anzahl = 7; // Anzahl der Bilder
var ZufallJetzt = new Date()
var ZufallsZahl = ZufallJetzt.getTime() % (Anzahl);
// Zuweisungen abhängig von der Zufallszahl
if (ZufallsZahl==0) {
TextFarbe = "#C04000";
GrafikUrl = "http://g.imagehost.org/0410/get_aspx.jpg";
UnterTitel="Natural Boost"
Link = "http://www.google.de"
}
if (ZufallsZahl==1) {
TextFarbe="#00BF00";
GrafikUrl = "http://g.imagehost.org/0145/get_aspx.jpg";
UnterTitel="Alpine > Dream"
Link = "http://www.google.de"
}
if (ZufallsZahl==2) {
TextFarbe="#00A050";
GrafikUrl = "http://g.imagehost.org/0515/get_aspx.jpg";
UnterTitel="Rolling Hills"
Link = "http://www.google.de"
}
if (ZufallsZahl==3) {
TextFarbe="#DF0000";
GrafikUrl = "http://g.imagehost.org/0991/get_aspx.jpg";
UnterTitel="Burn the Rubber"
Link = "http://www.google.de"
}
if (ZufallsZahl==4) {
TextFarbe="#9000E0";
GrafikUrl = "http://g.imagehost.org/0627/get_aspx.jpg";
UnterTitel="StaMetrical"
Link = "http://www.google.de"
}
if (ZufallsZahl==5) {
TextFarbe="#9000E0";
GrafikUrl = "http://g.imagehost.org/0394/get_aspx.jpg";
UnterTitel="[FS] NoBoost"
Link = "http://www.google.de"
}
if (ZufallsZahl==6) {
TextFarbe="#0070C0";
GrafikUrl = "http://g.imagehost.org/0679/get_aspx.jpg";
UnterTitel="Dead Island!"
Link = "http://www.google.de"
}
function Zufallsbild01() {
document.write("<a href=" + Link + "><img src='" + GrafikUrl+ "' width='320' height='240' border='1' alt='Texxxt'></a><br>")
document.write("<font color='" + TextFarbe +"'>" + UnterTitel + "</font><br>")
return
}
// -->
</script>
</head>
<body>
<div align="center">
<script type="text/javascript" language="JavaScript">
<!--
Zufallsbild01();
//-->
</script>
</div>
<br><br>
</body>
</html>

» [JAVA script]How to set a countdown script to forum/portal?
» Java Script
» Java script
» Java Script
» Java Script
» Java Script
» Java script
» Java Script
» Java Script
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum