Log in

View Full Version : Adding snow?


Kahoona
12-09-2004, 12:34 AM
Could someone please tell me how to add falling snow to my forum page.

Bad_i_BILL
12-09-2004, 01:10 AM
Like on mine?

www.gcindiana.info/forum3

Kahoona
12-09-2004, 01:14 AM
Yeah like that!

But without the big snowflakes in the top left.

Gio~Logist
12-09-2004, 01:54 AM
http://www.dynamicdrive.com/dynamicindex3/snow.htm


but that in your header template in the apropriate spot, thats what i did to get the side menu on

www.urbandynasty.com/forums

Kahoona
12-09-2004, 02:08 AM
I did that, and it wouldn't work...

Darat
12-09-2004, 09:11 AM
I've just tried the code from http://www.dynamicdrive.com/dynamicindex3/snow.htm .

The code seems to be fine, I put it in the headerinclude template and it is inserted into my forum pages, but it displays just one snowflake at the top left. If I use "preview" from the template manager it shows it working with moving snowflakes.

Anyone know why it won't work with a vBulletin forum page?

kall
12-09-2004, 09:26 AM
I've just tried the code from http://www.dynamicdrive.com/dynamicindex3/snow.htm .

The code seems to be fine, I put it in the headerinclude template and it is inserted into my forum pages, but it displays just one snowflake at the top left. If I use "preview" from the template manager it shows it working with moving snowflakes.

Anyone know why it won't work with a vBulletin forum page?
Are you using firefox, by any chance?

Try this:


//Configure below to change URL path to the snow image

var SnowPicture = "http://www.yourdomain.com/forum/images/misc/snow.gif"
var no = 10;

var browser_IE_NS = (document.body.clientHeight) ? 1 : 0;
var browser_MOZ = (self.innerWidth) ? 1 : 0;

var SnowTime;
var dx, xp, yp;
var am, stx, sty;
var i, Browser_Width, Browser_Height;

if (browser_IE_NS)
{
Browser_Width = document.body.clientWidth;
Browser_Height = document.body.clientHeight;
}
else if (browser_MOZ)
{
Browser_Width = self.innerWidth - 20;
Browser_Height = self.innerHeight;
}

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()*(Browser_Width-50);
yp[i] = Math.random()*Browser_Height;
am[i] = Math.random()*20;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
document.write("<\div id=\"snowflake"+ i +"\" style=\"position: absolute; z-index: "+ i +"; visibility: visible; top: 15px; left: 15px;\"><\img src='"+SnowPicture+"' border=\"0\"><\/div>");
}

function SnowWeather()
{

for (i = 0; i < no; ++ i)
{
yp[i] += sty[i];

if (yp[i] > Browser_Height-50)
{
xp[i] = Math.random()*(Browser_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("snowflake"+i).style.top=yp[i]+"px";
document.getElementById("snowflake"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px";
}

SnowTime = setTimeout("SnowWeather()", 10);

}

SnowWeather();
</script>

(Copy that over everything from the path to snow.gif down.)

Darat
12-09-2004, 09:53 AM
Thanks for the response and code.

I am using Firefox and the (original) code does work in the template preview (and the site's demo works) and when I checked it in IE 6 it also wasn't working.

I've just tried your code and I don't even get the solitary snowflake in the top left. :( (But again if I do preview from the template editor your code is working.) :disappointed:

kall
12-09-2004, 10:02 AM
Weird...

Check my site... http://www.nzboards.com ..

Does that work for you?

Darat
12-09-2004, 10:15 AM
In IE yes, in Firefox no.

Kahoona
12-09-2004, 02:22 PM
Well it worked until I refresh, but now I get "Done, but with errors on page." On the status bar.

Could you show me how to just add the white dots falling down, and not the images.

Zachery
12-09-2004, 03:09 PM
http://www.vbulletin.com/forum/showpost.php?p=774378&postcount=30 :)

Kahoona
12-09-2004, 06:17 PM
That website inside that link does not work.

Zachery
12-09-2004, 06:39 PM
That website inside that link does not work.
there, check now ;P

Kahoona
12-09-2004, 06:58 PM
Thanks again Zack. :)

Romeos Tune
12-13-2004, 02:03 AM
Where the heck should we put it? In the header template or the headerinclude? And where at? There is no <body> tag anywhere in there. Anyone?

Zachery
12-13-2004, 02:25 AM
did you try reading my post?


headinclude near the bottom

Romeos Tune
12-13-2004, 02:28 AM
Yeah.....I got the little snow that uses the snow.js script and that's working fine.... The big flakes are what I can't seem to get to work?

Zachery
12-13-2004, 02:46 AM
Yeah.....I got the little snow that uses the snow.js script and that's working fine.... The big flakes are what I can't seem to get to work?
They flatout dont work in Firefox IIRC and if any of your users are on lower end systems its not going to be a good time for them.

SHOBizzy
12-28-2004, 03:04 AM
Older topic yes, but I'd like to add my input on the snowflake js just so others who may be stumbling on this topic late like me will have a little more info.

The smaller flakes work great on both html based home pages like mine and when using the script like Zachery provided for the vB forum software. They have very little effect on page loading, etc.

The biggest hitch I had with using the larger snowflake js was that it increased my system's processes a LOT whenever the page using them was loaded, to the point that it slowed my browsing abilities and that to me is just not acceptable. I was concerned about the users on my BB who don't have as speedy computers and/or connections. I don't know if the script would have an effect on dial-up users or not but I wasn't willing to take the chance.

IMO the small flakes are more tasteful anyway because they add just a touch of class that doesn't distract the user from why they're visiting my board to begin with.

Sorry again for chiming in late.

Edit: My board with the smaller flakes.... www.shoforum.com
If you click the link for "Main Forum Listing Page" you'll see the vB software using the small flakes. I'm in process of learning how to change templates/styles right now they don't show up very well within the forum. Ahhh...things to come.