Hello,
I was wondering if there was a way to make it snow on a forum using an html code. Here is an example:
I've tried a few ways but I am literally a newbie at this kinda stuff. I would appreciate it a lot if you threw some help. Thanks.
Printable View
Hello,
I was wondering if there was a way to make it snow on a forum using an html code. Here is an example:
I've tried a few ways but I am literally a newbie at this kinda stuff. I would appreciate it a lot if you threw some help. Thanks.
No snow at the link you posted in Opera or FF, so I removed it. I would caution anyone from surfing to a page with a skull and crossbones on it in any other browser. Though it may have been innocent, and may have worked (snowed) in a less secure browser like Safari or IE.
If you are serious about snow, HTML will not be enough. There are tons of snow scripts around, but most are a bit dated, as this isn't really all that much in vogue among most current designers or coders. Lots of folks do seem to like snow around this time of year though.
Here's a fairly good script for snow:
http://home.comcast.net/~jscheuer1/s...s_bidirect.htm
The current demo is bubbles, and they are going up, but it can be configured to go down, and you may substitute your own snowflake image(s) for the bubble one.
Use your browser's 'view source' to get the code.
You misinterpreted what I meant. I gave an example of MY forum to clarify what kind of code I would need. I looked through the entire administration use and came across an HTML message board and tried posting this script in it:
http://www.hypergurl.com/snowpage.html
Only it didn't work, it just fed me back the code. Either I'm doing it wrong or it doesn't accept the code. I could reconfigure the whole page to HTML but I don't know how to do that.
Not entirely. That script (from hypergurl.com by Kurt Grigg - incidentally also available on Dynamic Drive, I think) is a good example of what I said:
I don't think that you did anything wrong, though you may. That Grigg script is outdated, for quirksmode only. That means that if your page validates, or even simply has a valid URL DOCTYPE (which I see it does), or is viewed in a standards compliant browser like FF or Safari even without a DOCTYPE, the script will not work.Quote:
tons of snow scripts around, but most are a bit dated
The code I linked you to will work. If you have problems with it, it is either not allowed by your host, there is an onload conflict with another script on your page, or you are doing something wrong.
If it's an onload conflict, just change:
to:Code:window.onload=fall;
Oh, and I just realized that I had an updated version of the Grigg script you seem to like (or one much like it) hanging around. It also should have no problems on your site if allowed and installed properly (put it in the head of your page):Code:if (window.addEventListener)
window.addEventListener('load',fall , false);
else if (window.attachEvent)
window.attachEvent('onload',fall );
Demo:Code:<script type="text/javascript">
<!--
/***********************************************
* Snow Effect Without Images - Modifications by John Davenport Scheuer
* on the script by the same name by Kurt Grigg at http://www.btinternet.com/~kurt.grigg/javascript
* Original (Kurt's Version) Script featured & available at Dynamic Drive at http://www.dynamicdrive.com/
* This notice must remain for legal use
***********************************************/
if (window.addEventListener || window.attachEvent){
(function(){
//Configure here.
var num = 30; //Number of flakes
var timer = 30; //setTimeout speed. Varies on different comps
var enableinNS6 = 1 //Enable script in NS6/FF/Mozilla? Snow animation could be slow in those browsers. (1=yes, 0=no).
//End Configure
var y = [];
var x = [];
var fall = [];
var theFlakes = [];
var sfs = [];
var step = [];
var currStep = [];
var h,w,r;
var d = document;
var pix = "px";
var domWw = (typeof window.innerWidth == "number");
var domSy = (typeof window.pageYOffset == "number");
var idx = d.getElementsByTagName('div').length;
if (domWw) r = window;
else{
if (d.documentElement &&
typeof d.documentElement.clientWidth == "number" &&
d.documentElement.clientWidth != 0)
r = d.documentElement;
else{
if (d.body &&
typeof d.body.clientWidth == "number")
r = d.body;
}
}
function winsize(){
var oh,sy,ow,sx,rh,rw;
if (domWw){
if (d.documentElement && d.defaultView &&
typeof d.defaultView.scrollMaxY == "number"){
oh = d.documentElement.offsetHeight;
sy = d.defaultView.scrollMaxY;
ow = d.documentElement.offsetWidth;
sx = d.defaultView.scrollMaxX;
if(typeof d.documentElement.clientHeight == "number" && r.innerHeight-d.documentElement.clientHeight==17)
rh = d.documentElement.clientHeight;
else if(typeof d.documentElement.clientHeight == "number" && d.documentElement.clientHeight > r.innerHeight)
rh = oh-sy;
else rh=r.innerHeight;
rw = ow-sx;
}
else{
rh = r.innerHeight;
rw = r.innerWidth;
}
h = rh - 2;
w = rw - 2;
}
else{
h = r.clientHeight - 2;
w = r.clientWidth - 2;
}
}
function scrl(yx){
var y,x;
if (domSy){
y = r.pageYOffset;
x = r.pageXOffset;
}
else{
y = r.scrollTop;
x = r.scrollLeft;
}
return (yx == 0)?y:x;
}
function snow(){
var dy,dx;
for (i = 0; i < num; i++){
dy = fall[i];
dx = fall[i] * Math.cos(currStep[i]);
y[i]+=dy;
x[i]+=dx;
if (x[i] >= w || y[i] >= h){
y[i] = -10;
x[i] = Math.round(Math.random() * w);
fall[i] = (sfs[i] == 1)?
Math.round(2 + Math.random() * 2): Math.round(3 + Math.random() * 2);
step[i] = (sfs[i] == 1)?
0.05 + Math.random() * 0.1 : 0.05 + Math.random() * 0.05 ;
}
theFlakes[i].top = y[i] + scrl(0) + pix;
theFlakes[i].left = x[i] + scrl(1) + pix;
currStep[i]+=step[i];
}
setTimeout(snow,timer);
}
function init(){
winsize();
for (var i = 0; i < num; i++){
sfs[i] = Math.round(1 + Math.random() * 1);
theFlakes[i] = d.createElement('div');
d.body.appendChild(theFlakes[i]);
theFlakes[i] = theFlakes[i].style;
theFlakes[i].position = 'absolute';
theFlakes[i].top = 0;
theFlakes[i].left = 0;
theFlakes[i].fontSize = theFlakes[i].height = theFlakes[i].width = sfs[i] + pix;
theFlakes[i].backgroundColor = '#fff';
currStep[i] = 0;
fall[i] = (sfs[i] == 1)?
Math.round(2 + Math.random() * 2): Math.round(3 + Math.random() * 2);
step[i] = (sfs[i] == 1)?
0.05 + Math.random() * 0.1 : 0.05 + Math.random() * 0.05 ;
y[i] = Math.round(Math.random()*h);
x[i] = Math.round(Math.random()*w);
}
snow();
}
if (window.addEventListener){
window.addEventListener("resize",winsize,false);
window.addEventListener("load",init,false);
}
else if (window.attachEvent){
window.attachEvent("onresize",winsize);
window.attachEvent("onload",init);
}
})();
}// End -->
</script>
http://home.comcast.net/~jscheuer1/side/snow_h_2.htm
Thank you!! I figured out what I did wrong. I deactivated HTML editor and it works beautifully. Thanks again!!!