The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Java script codes

+3
tid
darylldelfin
Mr.Recnikk
7 posters

Go down

Java script codes Empty Java script codes

Post by Mr.Recnikk November 28th 2008, 9:55 am

Where do I add JavaScrip comes (like falling snow and all that)?
avatar
Mr.Recnikk
New Member

Posts : 3
Reputation : 0
Language : Ancient Greek

View user profile

Back to top Go down

Java script codes Empty Re: Java script codes

Post by darylldelfin November 28th 2008, 11:32 am

you can inject scripts thru widgets .. modules > forum widget managements

or onto the homepage message ..

even on the site desciription ..
darylldelfin
darylldelfin
Forumember

Posts : 47
Reputation : 0
Language : english

View user profile http://www.hidecodesgalore.org

Back to top Go down

Java script codes Empty Re: Java script codes

Post by tid November 28th 2008, 7:11 pm

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
tid
Forumember

Male Posts : 115
Reputation : 0
Language : Polish, Lil bit English

View user profile

Back to top Go down

Java script codes Empty Re: Java script codes

Post by Gunhack X November 28th 2008, 10:42 pm

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>
Gunhack X
Gunhack X
Forumember

Male Posts : 479
Reputation : 14
Language : English, Español
Location : USA

View user profile http://windows.topgoo.net

Back to top Go down

Java script codes Empty Re: Java script codes

Post by Brad38 November 28th 2008, 11:39 pm

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.
Brad38
Brad38
Forumember

Male Posts : 667
Reputation : 32
Language : english

View user profile http://pigeonchat.forumakers.com/

Back to top Go down

Java script codes Empty Re: Java script codes

Post by Brad38 November 28th 2008, 11:54 pm

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.
Brad38
Brad38
Forumember

Male Posts : 667
Reputation : 32
Language : english

View user profile http://pigeonchat.forumakers.com/

Back to top Go down

Java script codes Empty Re: Java script codes

Post by Gunhack X November 29th 2008, 1:37 am

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
Gunhack X
Gunhack X
Forumember

Male Posts : 479
Reputation : 14
Language : English, Español
Location : USA

View user profile http://windows.topgoo.net

Back to top Go down

Java script codes Empty Re: Java script codes

Post by Brad38 November 29th 2008, 1:40 am

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.
Brad38
Brad38
Forumember

Male Posts : 667
Reputation : 32
Language : english

View user profile http://pigeonchat.forumakers.com/

Back to top Go down

Java script codes Empty Re: Java script codes

Post by Gunhack X November 29th 2008, 1:51 am

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:
<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
Gunhack X
Gunhack X
Forumember

Male Posts : 479
Reputation : 14
Language : English, Español
Location : USA

View user profile http://windows.topgoo.net

Back to top Go down

Java script codes Empty Re: Java script codes

Post by Brad38 November 29th 2008, 2:02 am

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! Smile Thanks, BUT, I have an actual homepage message on my forum that welcomes the members and explains the forum so can I still add it in there without code being seen?
Brad38
Brad38
Forumember

Male Posts : 667
Reputation : 32
Language : english

View user profile http://pigeonchat.forumakers.com/

Back to top Go down

Java script codes Empty Re: Java script codes

Post by Brad38 November 29th 2008, 2:06 am

Nevermind...thanks so much....got it to work!!! Smile Very Happy Thanks again so much Smile
Brad38
Brad38
Forumember

Male Posts : 667
Reputation : 32
Language : english

View user profile http://pigeonchat.forumakers.com/

Back to top Go down

Java script codes Empty Re: Java script codes

Post by Gunhack X November 29th 2008, 2:13 am

May you please give your forum URL? I want to see it.
Gunhack X
Gunhack X
Forumember

Male Posts : 479
Reputation : 14
Language : English, Español
Location : USA

View user profile http://windows.topgoo.net

Back to top Go down

Java script codes Empty Re: Java script codes

Post by Nessa November 29th 2008, 5:10 am

Is this problem resolved?


Nessa
Nessa
Energetic

Female Posts : 6203
Reputation : 128
Language : English

View user profile

Back to top Go down

Java script codes Empty Re: Java script codes

Post by Gunhack X November 29th 2008, 7:13 am

Yes, Mrs. Nessa, but I have a question for you.

Are you that girl in the avatar?
Gunhack X
Gunhack X
Forumember

Male Posts : 479
Reputation : 14
Language : English, Español
Location : USA

View user profile http://windows.topgoo.net

Back to top Go down

Java script codes Empty Re: Java script codes

Post by tid November 29th 2008, 10:51 am

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 Wink

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.

Spoiler:
tid
tid
Forumember

Male Posts : 115
Reputation : 0
Language : Polish, Lil bit English

View user profile

Back to top Go down

Java script codes Empty Re: Java script codes

Post by cheap jeep June 3rd 2009, 10:42 am

One question:
For me that script works too, but not in portal:
There I tried that javascript and it didnt work either Sad
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>
avatar
cheap jeep
Forumember

Posts : 28
Reputation : 0
Language : German

View user profile http://madtrackers.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum