Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

Paste Description for Snow Effect

Its winter season, decorate your blog with with a great animated snow fall effect. Even Google and Yahoo change their homepage for Christmas, why not you ?
http://tech-buzz.net/2006/12/17/give-snow-effect-to-your-blog/

Snow Effect
Monday, December 18th, 2006 at 11:02:44pm UTC 

This post has 1 comment thread shown at the end of this page.

  1. <script type="text/javascript">
  2.  
  3. /******************************************
  4. * Snow Effect Script- By Altan d.o.o. (http://www.altan.hr/snow/index.html)
  5. * Visit Dynamic Drive DHTML code library (http://www.dynamicdrive.com/) for full source code
  6. * Last updated Nov 9th, 05' by DD. This notice must stay intact for use
  7. ******************************************/
  8.  
  9.   //Configure below to change URL path to the snow image
  10.   var snowsrc="http://img226.imageshack.us/img226/9894/snow3gy1.gif"
  11.   // Configure below to change number of snow to render
  12.   var no = 10;
  13.   // Configure whether snow should disappear after x seconds (0=never):
  14.   var hidesnowtime = 0;
  15.   // Configure how much snow should drop down before fading ("windowheight" or "pageheight")
  16.   var snowdistance = "pageheight";
  17.  
  18. ///////////Stop Config//////////////////////////////////
  19.  
  20.   var ie4up = (document.all) ? 1 : 0;
  21.   var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
  22.  
  23.         function iecompattest(){
  24.         return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
  25.         }
  26.  
  27.   var dx, xp, yp;    // coordinate and position variables
  28.   var am, stx, sty;  // amplitude and step variables
  29.   var i, doc_width = 800, doc_height = 600;
  30.  
  31.   if (ns6up) {
  32.     doc_width = self.innerWidth;
  33.     doc_height = self.innerHeight;
  34.   } else if (ie4up) {
  35.     doc_width = iecompattest().clientWidth;
  36.     doc_height = iecompattest().clientHeight;
  37.   }
  38.  
  39.   dx = new Array();
  40.   xp = new Array();
  41.   yp = new Array();
  42.   am = new Array();
  43.   stx = new Array();
  44.   sty = new Array();
  45.   snowsrc=(snowsrc.indexOf("dynamicdrive.com")!=-1)? "snow.gif" : snowsrc
  46.   for (i = 0; i < no; ++ i) { 
  47.     dx[i] = 0;                        // set coordinate variables
  48.     xp[i] = Math.random()*(doc_width-50)// set position variables
  49.     yp[i] = Math.random()*doc_height;
  50.     am[i] = Math.random()*20;         // set amplitude variables
  51.     stx[i] = 0.02 + Math.random()/10; // set step variables
  52.     sty[i] = 0.7 + Math.random();     // set step variables
  53.                 if (ie4up||ns6up) {
  54.       if (i == 0) {
  55.         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>");
  56.       } else {
  57.         document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"><\/div>");
  58.       }
  59.     }
  60.   }
  61.  
  62.   function snowIE_NS6() {  // IE and NS6 main animation function
  63.     doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;
  64.                 doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")?  iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;
  65.     for (i = 0; i < no; ++ i) {  // iterate for every dot
  66.       yp[i] += sty[i];
  67.       if (yp[i] > doc_height-50) {
  68.         xp[i] = Math.random()*(doc_width-am[i]-30);
  69.         yp[i] = 0;
  70.         stx[i] = 0.02 + Math.random()/10;
  71.         sty[i] = 0.7 + Math.random();
  72.       }
  73.       dx[i] += stx[i];
  74.       document.getElementById("dot"+i).style.top=yp[i]+"px";
  75.       document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px"
  76.     }
  77.     snowtimer=setTimeout("snowIE_NS6()", 10);
  78.   }
  79.  
  80.         function hidesnow(){
  81.                 if (window.snowtimer) clearTimeout(snowtimer)
  82.                 for (i=0; i<no; i++) document.getElementById("dot"+i).style.visibility="hidden"
  83.         }
  84.                
  85.  
  86. if (ie4up||ns6up){
  87.     snowIE_NS6();
  88.                 if (hidesnowtime>0)
  89.                 setTimeout("hidesnow()", hidesnowtime*1000)
  90.                 }
  91.  
  92. </script>

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus

comments on this paste

Snow Effect (#284206)

Posted: December 7th, 2008 at 9:13pm UTC

Do you think you can find a way to make it snow on a google site??? it doesn't let me use the word script at all

worth-right