Add to Google

JavaScript--A snow storm

Pages: 1, 2
free web hosting

Read Latest Entries..: (Post #13) by Ruben on Dec 13 2008, 09:32 PM. (Line Breaks Removed)
I thought it was great, but as everyone said, and I thought would happen, it slowed down my site too much. Great idea though. I'm sure it will come handy to those with high powered servers.
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Open Discussion > Have your say > General Talk

JavaScript--A snow storm

k8donline
A snow storm: after <BODY> or <HEAD>


QUOTE
<body bgcolor=#000000 onLoad=\"snow()\">
<script language=\"JavaScript\">
<!--  
N = 40;  
Y = new Array();
X = new Array();
S = new Array();
A = new Array();
B = new Array();
M = new Array();
V = (document.layers)?1:0;

iH=(document.layers)?window.innerHeight:window.document.body.clientHeight;
iW=(document.layers)?window.innerWidth:window.document.body.clientWidth;
for (i=0; i < N; i++){                                                                
Y[i]=Math.round(Math.random()*iH);
X[i]=Math.round(Math.random()*iW);
S[i]=Math.round(Math.random()*5+2);
A[i]=0;
B[i]=Math.random()*0.1+0.1;
M[i]=Math.round(Math.random()*1+1);
}
if (V){
for (i = 0; i < N; i++)
{document.write(\"<LAYER NAME='sn\"+i+\"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,\"+M[i]+\",\"+M[i]+\"'></LAYER>\")}
}
else{
document.write('<div style=\"position:absolute;top:0px;left:0px\">');
document.write('<div style=\"position:relative\">');
for (i = 0; i < N; i++)
{document.write('<div id=\"si\" style=\"position:absolute;top:0;left:0;width:'+M[i]+';height:'+M[i]+';background:#fffff0;font-size:'+M[i]+'\"></div>')}
document.write('</div></div>');
}
function snow(){
var H=(document.layers)?window.innerHeight:window.document.body.clientHeight;
var W=(document.layers)?window.innerWidth:window.document.body.clientWidth;
var T=(document.layers)?window.pageYOffset:document.body.scrollTop;
var L=(document.layers)?window.pageXOffset:document.body.scrollLeft;
for (i=0; i < N; i++){
sy=S[i]*Math.sin(90*Math.PI/180);
sx=S[i]*Math.cos(A[i]);
Y[i]+=sy;
X[i]+=sx;  
if (Y[i] > H){
Y[i]=-10;
X[i]=Math.round(Math.random()*W);
M[i]=Math.round(Math.random()*1+1);
S[i]=Math.round(Math.random()*5+2);
}
if (V){document.layers['sn'+i].left=X[i];document.layers['sn'+i].top=Y[i]+T}
else{si[i].style.pixelLeft=X[i];si[i].style.pixelTop=Y[i]+T}  
A[i]+=B[i];
}
setTimeout('snow()',10);
}
//-->
</script>

 

 

 


Comment/Reply (w/o sign-up)

hellomyfriends
Hey man,it's so cool, i need it for my Xmas site.lol laugh.gif

Comment/Reply (w/o sign-up)

Minisheep
Wonderful.Maybe you can use some images instead of the white block.

Comment/Reply (w/o sign-up)

k8donline
nice idea!but the website will be slow down.

Comment/Reply (w/o sign-up)

hellomyfriends
yes,your site will be slowed down

Comment/Reply (w/o sign-up)

clffworld
I think the site will be slow down too.
But its cool! smile.gif

Comment/Reply (w/o sign-up)

andrej
I copyed this in dreamweaver 2004 after <head> and it is not working. :roll: :|
:shock: can somebody tell me more specificly? :roll:

Comment/Reply (w/o sign-up)

God
Did you put this in your body tag:
CODE
onload="javascript: snow()"

Comment/Reply (w/o sign-up)

andrej
:shock: no I will try laugh.gif

Comment/Reply (w/o sign-up)

criminalid
Yeah,

I already used this code one time... Its so pretty cool laugh.gif

For X-Mas Site so.... hehehe

Comment/Reply (w/o sign-up)

Latest Entries

Ruben
I thought it was great, but as everyone said, and I thought would happen, it slowed down my site too much. Great idea though. I'm sure it will come handy to those with high powered servers. biggrin.gif

Comment/Reply (w/o sign-up)

Echo_of_thunder
QUOTE (Minisheep @ Jan 5 2005, 07:27 AM) *
Wonderful.Maybe you can use some images instead of the white block.



QUOTE (k8donline @ Jan 7 2005, 02:32 AM) *
nice idea!but the website will be slow down.


yes some snow flake images would look a lot better for this script, but as said it will slow down the site. I have used the same script myself, and every time I would always get someone telling me. remove it, it freeze up my system or makes it too slow.

Comment/Reply (w/o sign-up)

ninja-b
tnx for the script its is good i chaked it smile.gif

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Pages: 1, 2
Recent Queries:-
  1. storm javascript code - 8.59 hr back. (1)
  2. snow storm javascript - 15.29 hr back. (1)
  3. my snow effect javascript is not working - 166.68 hr back. (1)
  4. javascript snow html - 171.99 hr back. (1)
  5. javascript snow - 193.91 hr back. (1)
  6. round snow small image javascript - 212.27 hr back. (1)
  7. snow javascript html - 223.11 hr back. (2)
  8. snowstorm javascript - 80.16 hr back. (3)
  9. snowstorm effect in javascript - 231.32 hr back. (1)
  10. javascript snow storm - 266.60 hr back. (1)
  11. javascript snowstorm - 290.69 hr back. (2)
  12. javascript for snow in a cell - 291.15 hr back. (1)
  13. snowfall javascript code - 300.02 hr back. (1)
Similar Topics

Keywords : javascript, snow, storm

  1. Storm Chaser
    A New Season (2)
  2. Brain Storm
    some new ideas for topics (6)
    I’ve been too busy lately but whenever I go to these forums I feel it’s too difficult to find topics
    I’m interested in. So I thought I would brain storm some new ideas for topics. 1) I’ve been
    watching Prison Break on TV, any one else feel like talking about this show? 2) I pirate a lot of
    software. Now I will respect the rules of this forum, and I won’t tell anyone where or how I do it
    but I don’t think it’s wrong. I think software is too expensive and I should not have to pay for
    software that has questionable functionality. Any thoughts? 3) I have acne, I use....
  3. Iframe External Link (Javascript)
    (0)
    This code will allow people who use iframes to link to there page, then load the iframe so that they
    can give external links to people that will link directly to the iframe page they want to see.
    now this first part has to be in the head of your document CODE window.onload = function
    setIframe() { var url = window.location.href; var i = url.indexOf("?i="); if( i>-1 ) {
     url = url.substr(i+3);  document.getElementById("body").src = url; } } now this is
    about how your iframe tag should look CODE of course replace th....
  4. Javascript/HTML form submissions On a Mac
    (1)
    My hope is that someone out there can help me with this problem. I have some javascript that will go
    thru (on a PC that is) a HTML page looking for a specifc word submitted via an onclick function.
    Orginally it was a form submission with an onsubmit that ran the function. But in trying to
    trouble shoot it I thought the mac was submitting the form differently than the PC versions (maybe
    the DOM) so I created a button with an onclick command. Again it works for the PC but not for the
    MAC. I am at my wits end. If someone can help; below is the code I am using. I....
  5. Javascript loading iframes
    (1)
    Im getting this message CODE Line: 14 Char: 3 Error: 'document.getElementByID(...)' is null
    or not an object Code: 0 URL: http://www.stoneddevilinc.com?i=full_site_part_1.html when i
    try to run this code CODE function setIframe() { var url = window.location.href;
    var i = url.indexOf("?i="); if( i>-1 ) {  url = url.substr(i+3);
     document.getElementById("content").src = url; } } window.onload = setIframe();
    with this url CODE http://www.stoneddevilinc.com/?i=full_site_part_1.html to pull up
    this ifra....
  6. JavaScript PHP redirecting
    (2)
    Hi there! /biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /> Is
    there a way to use JS to change a form's submit target based on which submit button was pressed?
    Eg. CODE Register Login Thank you!! Added code tags--CodeFX ....
  7. javascript
    (3)
    some nice javascript to add in your site CODE cell bg changer .tditem { font-size:
    12px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none; color: gray; }
    Item 1 | Item 2 | Item 3
    ....
  8. A GREAT JAVASCRIPT COLLECTION
    (1)
    Best program containing many Java scripts AA Scripter. Can be downloaded from this link
    http://www.cyberiapc.com/aa/aascripter.htm **Changed all caps to correct case. --CodeFX ....
  9. Excellent site for Javascript Tools
    (1)
    This is the best source for Javascript tools. http://www.codebrain.com/ **Removed all caps
    --CodeFX ....
  10. Browser Redirection Javascript code.
    (1)
    Hi does anyone have a browser direction code( so if someone went to my site with IE it would forward
    to a site telling you to download Firefox). If so could you email it to me : daniel dot maxson at
    gmail dot com Thanks Daniel....
  11. Kickoff Frame Javascript
    (1)
    Hi I have this javascript ------------------------------ CODE if
    (parent.frames.length==0) parent.location.href="Redirect to?" -->
    ------------------------------ Is this the right one for kicking off frames? Dani **Code
    tags added**--CodeFX ....
  12. [JavaScript] Check for Flash
    (0)
    This script i have modified. With this script you can check if Flash is installed. CODE  
      var flashinstalled = 0;   var flashversion = 0;   MSDetect = "false";   if
    (navigator.plugins && navigator.plugins.length)   {      x = navigator.plugins ;      if (x)
         {         flashinstalled = 2;         if (x.description)         {            y =
    x.description;            flashversion = y.charAt(y.indexOf('.')-1);         }      }    
     else         flashinstalled = 1;      if (navigator.plugins )      {         flashinsta....
  13. Javascript? I Need a random picture thingy>>>
    (6)
    I need a script or something so that every time a page is loaded, there is a different picture
    shown...? and so I can like put a list of URL's and it goes through them randomly or just has an
    order.......
  14. I really need a java script special effect like snow storm.
    (4)
    I would like some special on my site. If you know the code for making a snow storm please respond.
    I would really thank you.....
  15. internet security problems, can't open javascript!
    (1)
    Help me out please. I was trying to use a new anti virus program, Kaspersky. After I used it for one
    full scan my computer has gone totally mad! On the internet I cant open half the links, anything
    with javascript. on the bottom of my browser it just starts complaining... Even worse is the fact
    that I can't open my Windows Mediapplayer since the scan. It just says: 'internal application
    error'. I tried everything; uninstall, reinstall, I can use the mplayer2, but I'm used to the luxury
    of WMP10. Please help me out guys. My room is too quiet without my music........
  16. Javascript sites
    (9)
    Here are some sites for your javascript needs: http://www.dynamicdrive.com/
    http://www.javascript-2.com/ http://javascript.internet.com/
    http://javascriptkit.com/script/cut57.shtml http://www.webreference.com/js/
    http://www.codehouse.com/ http://www.freewarejava.com/ http://a1javascripts.com/
    http://hotscript.com/ To Learn javascript: http://www.javascriptmall.com/learn/contents.htm
    http://www.w3schools.com/js/default.asp Good luck!....
  17. Baltic Storm
    Most Baltic countries were affected (0)
    There was a storm over the Baltic countries and parts of Scandinavia the 9th and 10th. A third of
    Estonia was without power. Pärnu was partially flooded. The water level was 3 metres higher than
    usual near the beach area (probably will have the worst water-damage). Here's some pictures of
    the damage made by the storm in Pärnu and the rescue operation. ....

    1. Looking for javascript, snow, storm

Searching Video's for javascript, snow, storm




advertisement



JavaScript--A snow storm