Search in forum:
Search


Author Message
Post10/20/2008 at 2:01pm (UTC)    
Post subject: Code for dictionary box

Code:
<!--dictionary lookup box by TheFreeDictionary.com--><style type="text/css">

 

 

#dictionarybox TD, INPUT, SELECT {font-size:10pt;}</style>
<form style="display: inline; margin: 0pt" action="http://www.thefreedictionary.com/_/partner.aspx" method="get" target="_top" name="dictionary">
    <table id="dictionarybox" style="border-right: rgb(32,178,170) 1px solid; border-top: rgb(32,178,170) 1px solid; border-left: rgb(32,178,170) 1px solid; width: 230px; color: rgb(0,0,0); border-bottom: rgb(32,178,170) 1px solid; font-family: Arial; background-color: rgb(240,255,240)" cellspacing="0" cellpadding="3">
        <tbody>
            <tr>
                <td style="border-bottom: rgb(32,178,170) 1px solid" bgcolor="#5f9ea0"><img height="25" alt="" width="25" src="http://img.tfd.com/Help.gif?0" /></td>
                <td style="border-bottom: rgb(32,178,170) 1px solid" nowrap="nowrap" bgcolor="#5f9ea0" colspan="2"><a style="color: rgb(255,255,255); text-decoration: none" href="http://www.thefreedictionary.com">
                <div style="font-size: 12pt"><strong>Online Reference</strong></div>
                <div style="font-size: 8pt">Dictionary, Encyclopedia &amp; more</div>
                </a></td>
            </tr>
            <tr>
                <td align="center">Word:<br />
                <img id="dictionarybox_img_toggle" style="cursor: pointer" alt="" onclick="var s=document.getElementById('dictionarybox_source').style;this.src='http://img.tfd.com/toggle/b-'+(s.display?'up.gif':'down.gif');s.display=(s.display?'':'none')" src="http://img.tfd.com/toggle/b-up.gif" /></td>
                <td colspan="2"><input size="26" name="Word" type="text" /></td>
            </tr>
            <tr id="dictionarybox_source">
                <td align="right">Look in:</td>
                <td id="boxsource_td" style="font-size: 8pt; text-align: left" colspan="2"><style type="text/css">

 

 

#boxsource_td A {color:#000000;text-decoration:none}</style><!--[if IE]><style>#boxsource_td INPUT {height:12pt}</style><![endif]--><input type="radio" checked="checked" name="Set" value="www" /><a href="http://www.thefreedictionary.com">Dictionary &amp; thesaurus</a><br />
                <input type="radio" name="Set" value="medical-dictionary" /><a href="http://medical-dictionary.thefreedictionary.com">Medical Dictionary</a><br />
                <input type="radio" name="Set" value="legal-dictionary" /><a href="http://legal-dictionary.thefreedictionary.com">Legal Dictionary</a><br />
                <input type="radio" name="Set" value="financial-dictionary" /><a href="http://financial-dictionary.thefreedictionary.com">Financial Dictionary</a><br />
                <input type="radio" name="Set" value="acronyms" /><a href="http://acronyms.thefreedictionary.com">Acronyms</a><br />
                <input type="radio" name="Set" value="idioms" /><a href="http://idioms.thefreedictionary.com">Idioms</a><br />
                <input type="radio" name="Set" value="encyclopedia2" /><a href="http://encyclopedia2.thefreedictionary.com">Encyclopedia</a><br />
                <input type="radio" name="Set" value="encyclopedia" /><a href="http://encyclopedia.thefreedictionary.com">Wikipedia</a><br />
                <input type="radio" name="Set" value="periodicals" /><a href="http://www.thefreelibrary.com">Periodicals</a><br />
                <input type="radio" name="Set" value="literature" /><a href="http://www.thefreelibrary.com/literature.aspx">Literature</a>
                <div style="cursor: pointer" onclick="var s=document.getElementById('dictionarybox_ol').style;document.getElementById('dictionarybox_ol_img').src='http://img.tfd.com/toggle/b-'+(s.display?'up.gif':'down.gif');s.display=(s.display?'':'none')"><img id="dictionarybox_ol_img" alt="" src="http://img.tfd.com/toggle/b-up.gif" />Other languages:</div>
                <div id="dictionarybox_ol"><input type="radio" name="Set" value="es" /><a href="http://es.thefreedictionary.com">Spanish Dictionary</a><br />
                <input type="radio" name="Set" value="de" /><a href="http://de.thefreedictionary.com">German Dictionary</a><br />
                <input type="radio" name="Set" value="fr" /><a href="http://fr.thefreedictionary.com">French Dictionary</a><br />
                <input type="radio" name="Set" value="it" /><a href="http://it.thefreedictionary.com">Italian Dictionary</a><br />
                <input type="radio" name="Set" value="zh" /><a href="http://zh.thefreedictionary.com">Chinese Dictionary</a><br />
                <input type="radio" name="Set" value="pt" /><a href="http://pt.thefreedictionary.com">Portuguese Dictionary</a><br />
                <input type="radio" name="Set" value="nl" /><a href="http://nl.thefreedictionary.com">Dutch Dictionary</a><br />
                <input type="radio" name="Set" value="no" /><a href="http://no.thefreedictionary.com">Norwegian Dictionary</a><br />
                <input type="radio" name="Set" value="el" /><a href="http://el.thefreedictionary.com">Greek Dictionary</a><br />
                <input type="radio" name="Set" value="ru" /><a href="http://ru.thefreedictionary.com">Russian Dictionary</a></div>
                </td>
            </tr>
            <tr>
                <td align="right">by:</td>
                <td><select name="mode">
                <option value="w" selected="selected">Word</option>
                <option value="s">Starts with</option>
                <option value="e">Ends with</option>
                <option value="d">Mentions</option>
                </select></td>
                <td align="right"><input type="submit" name="submit" value="Look it up" /></td>
            </tr>
        </tbody>
    </table>
    <a href="http://freedomains.page.tl/>Free Domains</a>
    <br />
    <br />
</form>
Post10/20/2008 at 2:02pm (UTC)    
Post subject:

Stock Market ticker code

Code:
<APPLET NAME="Ticker2"
      CODE="Ticker.class"
      ARCHIVE="Ticker.jar"
      CODEBASE="http://java.barchart.com/ticker"
      HEIGHT="48"
      WIDTH="450"
   >
      <PARAM NAME="panels"    VALUE="3">

      <PARAM NAME="1:symbols"   VALUE="'Indices,$NASX:Nasdaq,$NYS:NYSE,$IUX:Russell,$VLA:Value Line">
      <PARAM NAME="1:scroll"    VALUE="-1, 100">
      <PARAM NAME="1:bgcolor"   VALUE="#0000FF">
      <PARAM NAME="1:fgcolor"   VALUE="#FFFFFF">
      <PARAM NAME="1:pscolor"   VALUE="#00CC00">
      <PARAM NAME="1:ngcolor"   VALUE="#FF3333">
      <PARAM NAME="1:hilight"   VALUE="#FFFF00">
      <PARAM NAME="1:font"      VALUE="Arial, Normal, 10">

      <PARAM NAME="2:symbols"   VALUE="'Stocks,MSFT:Microsoft,IBM,QQQQ,SIEB:Siebert,TSA:Sports Authority,EBAY,YHOO:Yahoo!">
      <PARAM NAME="2:scroll"    VALUE="-1, 200">
      <PARAM NAME="2:bgcolor"   VALUE="#FFFFFF">
      <PARAM NAME="2:fgcolor"   VALUE="#000000">
      <PARAM NAME="2:pscolor"   VALUE="#00AA00">
      <PARAM NAME="2:ngcolor"   VALUE="#AA0000">
      <PARAM NAME="2:hilight"   VALUE="#0000FF">
      <PARAM NAME="2:font"      VALUE="Arial, Normal, 10">

      <PARAM NAME="3:symbols"   VALUE="'Commodities,CZ7:Dec Corn,LHY0:Lean Hogs Spot,SPZ7:S&P 500 Futures">
      <PARAM NAME="3:scroll"    VALUE="-1,  50">
      <PARAM NAME="3:bgcolor"   VALUE="#333333">
      <PARAM NAME="3:fgcolor"   VALUE="#FFFFFF">
      <PARAM NAME="3:pscolor"   VALUE="#00CC00">
      <PARAM NAME="3:ngcolor"   VALUE="#FF3333">
      <PARAM NAME="3:hilight"   VALUE="#CCFFFF">
      <PARAM NAME="3:font"      VALUE="Arial, Normal, 10">
   </APPLET>
Post10/20/2008 at 3:10pm (UTC)    
Post subject:

Clock Blue


Code:
<iframe style="width: 232px; height: 143px" border="0" name="iframe" align="absMiddle" marginwidth="1" marginheight="1" src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/datetime.xml&amp;up_color=blue&amp;up_firstDay=1&amp;up_clocks=%5B%5B-73.986951%2C40.756054%2C%22New%20York%22%2C0%5D%5D&amp;synd=open&amp;w=320&amp;h=140&amp;title=__MSG_title__&amp;lang=de&amp;country=ALL&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;source=http%3A%2F%2Fwww.gmodules.com%2Fig%2Fcreator%3Fsynd%3Dopen%26url%3Dhttp%253A%2F%2Fwww.google.com%2Fig%2Fmodules%2Fdatetime.xml%26pt%3D%2526context%253Db%2526synd%253Dopen%2526lang%253Dde%2526.lang%253Dde%2526country%253Dus%2526.country%253Dus%2526cat%253Dall%2526num%253D24%2526start%253D0%2526cols%253D4%2526objs%253Dw%252CRPf%252C57k%252COC%252Cou%252Cjyq%252CcK%252CHZx%252CiO%252Cfrb%252C25Mb%252Chs2%252Cuzc%252C8%252CKKO%252CxGa6%252CGl%252CgZ3%252Cplj%252CTA%252C7Wu%252CjhP%252CHQ%252CWXnd%26sn%3Dw%26lang%3Dde" frameborder="0" width="1000" scrolling="no" height="50">
</body></html></iframe>
Post10/20/2008 at 3:17pm (UTC)    
Post subject:

WeatherBug

Code:
<iframe style="width: 288px; height: 256px" border="0" name="iframe" align="absMiddle" marginwidth="1" marginheight="1" src="http://www.gmodules.com/ig/ifr?url=http://www.labpixies.com/campaigns/weather/weather.xml&amp;up_degree_unit_type=0&amp;up_first_load=1&amp;up_locations=0&amp;up_zip_code=0&amp;up_city_code=0&amp;up_disable_os=0&amp;synd=open&amp;w=320&amp;h=230&amp;title=Live+Weather&amp;lang=all&amp;country=ALL&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;source=http%3A%2F%2Fwww.gmodules.com%2Fig%2Fcreator%3Fsynd%3Dopen%26url%3Dhttp%253A%2F%2Fwww.labpixies.com%2Fcampaigns%2Fweather%2Fweather.xml%26pt%3D%2526context%253Db%2526synd%253Dopen%2526lang%253Den%2526.lang%253Den%2526country%253Dus%2526.country%253Dus%2526cat%253Dall%2526num%253D24%2526start%253D0%2526cols%253D4%2526objs%253DOVJ%252CFoc%252CUQJ%252CXtm%252C33G%252Cjyq%252CpV%252CRB%252COUg%252Cw%252Cc17%252CbZ3%252ChJi%252CgP1%252CFrT%252COC%252CpFi%252C7Wu%252Cevi%252CUvgp%252Cs%252CWXnd%252CUAc%252Cewc%26sn%3DOVJ%26lang%3Den" frameborder="0" width="470" scrolling="no" height="470">
</body></html></iframe>
Post12/29/2008 at 1:27pm (UTC)    
Post subject: Basic HTML Scroll Box

Basic HTML Scroll Box

HTML code:
Code:
<!-- HTML Codes by Quackit.com --> <div style="height:120px;width:250px;font:16px/26px Georgia, Garamond, Serif;overflow:scroll;"> As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box. </div> <p style="font-family:verdana,arial,sans-serif;font-size:10px;"><a href="http://www.quackit.com/html/codes/html_scroll_box.cfm">HTML scroll box</a></p>
Post12/29/2008 at 1:27pm (UTC)    
Post subject:

scroll box.
HTML Code:
Code:
<!-- Codes by Quackit.com --> <div style="height:90px;width:160px;overflow:scroll;background-color:#67F152;">We have added a background color to this HTML scroll box. This is done using the CSS 'background-color' property.</div> <p style="font-family:verdana,arial,sans-serif;font-size:10px;"><a href="http://www.quackit.com/html/codes/">HTML Codes</a></p>
Post12/29/2008 at 1:28pm (UTC)    
Post subject:

Romantic hearts following mouse cursor

Code:
<!-- This Script is from www.htmlfreecodes.com, Coded by: Krishna Eydatoula-->
<div id="dot0" style="position: absolute; visibility: hidden; height: 11; width: 11;">
   <img src="http://www.htmlfreecodes.com/heart.gif" height=11 width=11>
</div>
<div id="dot1" style="position: absolute; height: 11; width: 11;">
   <img src="http://www.htmlfreecodes.com/heart.gif" height=11 width=11>
</div>
<div id="dot2" style="position: absolute; height: 11; width: 11;">
   <img src="http://www.htmlfreecodes.com/heart.gif" height=11 width=11>
</div>
<div id="dot3" style="position: absolute; height: 11; width: 11;">
   <img src="http://www.htmlfreecodes.com/heart.gif" height=11 width=11>
</div>
<div id="dot4" style="position: absolute; height: 11; width: 11;">
   <img src="http://www.htmlfreecodes.com/heart.gif" height=11 width=11>
</div>
<div id="dot5" style="position: absolute; height: 11; width: 11;">
   <img src="http://www.htmlfreecodes.com/heart.gif" height=11 width=11>
</div>
<div id="dot6" style="position: absolute; height: 11; width: 11;">
   <img src="http://www.htmlfreecodes.com/heart.gif" height=11 width=11>
</div>

<script LANGUAGE="JavaScript">
<!-- hide code

var nDots = 7;

var Xpos = 0;
var Ypos = 0;

  // fixed time step, no relation to real time
var DELTAT = .01;
  // size of one spring in pixels
var SEGLEN = 10;
  // spring constant, stiffness of springs
var SPRINGK = 10;
  // all the physics is bogus, just picked stuff to
  // make it look okay
var MASS = 1;
// Positive XGRAVITY pulls right, negative pulls left
// Positive YGRAVITY pulls down, negative up
var XGRAVITY = 0;
var YGRAVITY = 50;
// RESISTANCE determines a slowing force proportional to velocity
var RESISTANCE = 10;
  // stopping criterea to prevent endless jittering
  // doesn't work when sitting on bottom since floor
  // doesn't push back so acceleration always as big
  // as gravity
var STOPVEL = 0.1;
var STOPACC = 0.1;
var DOTSIZE = 11;
  // BOUNCE is percent of velocity retained when
  // bouncing off a wall
var BOUNCE = 0.75;

var isNetscape = navigator.appName=="Netscape";

  // always on for now, could be played with to
  // let dots fall to botton, get thrown, etc.
var followmouse = true;

var dots = new Array();
init();

function init()
{
    var i = 0;
    for (i = 0; i < nDots; i++) {
        dots[i] = new dot(i);
    }
   
    if (!isNetscape) {
        // I only know how to read the locations of the
        // <LI> items in IE
        //skip this for now
        // setInitPositions(dots)
    }
   
    // set their positions
    for (i = 0; i < nDots; i++) {
        dots[i].obj.left = dots[i].X;
        dots[i].obj.top = dots[i].Y;
    }
   
   
    if (isNetscape) {
        // start right away since they are positioned
        // at 0, 0
        startanimate();
    } else {
        // let dots sit there for a few seconds
        // since they're hiding on the real bullets
        setTimeout("startanimate()", 1000);
    }
}



function dot(i)
{
    this.X = Xpos;
    this.Y = Ypos;
    this.dx = 0;
    this.dy = 0;
    if (isNetscape) {   
        this.obj = eval("document.dot" + i);
    } else {
        this.obj = eval("dot" + i + ".style");
    }
}


function startanimate() {   
    setInterval("animate()", 20);
}


// This is to line up the bullets with actual LI tags on the page
// Had to add -DOTSIZE to X and 2*DOTSIZE to Y for IE 5, not sure why
// Still doesn't work great
function setInitPositions(dots)
{
    // initialize dot positions to be on top
    // of the bullets in the <ul>
    var startloc = document.all.tags("LI");
    var i = 0;
    for (i = 0; i < startloc.length && i < (nDots - 1); i++) {
        dots[i+1].X = startloc[i].offsetLeft
            startloc[i].offsetParent.offsetLeft - DOTSIZE;
        dots[i+1].Y = startloc[i].offsetTop +
            startloc[i].offsetParent.offsetTop + 2*DOTSIZE;
    }
    // put 0th dot above 1st (it is hidden)
    dots[0].X = dots[1].X;
    dots[0].Y = dots[1].Y - SEGLEN;
}

// just save mouse position for animate() to use
function MoveHandler(e)
{
    Xpos = e.pageX;
    Ypos = e.pageY;    
    return true;
}

// just save mouse position for animate() to use
function MoveHandlerIE() {
    Xpos = window.event.x + document.body.scrollLeft;
    Ypos = window.event.y + document.body.scrollTop;    
}

if (isNetscape) {
    document.captureEvents(Event.MOUSEMOVE);
    document.onMouseMove = MoveHandler;
} else {
    document.onmousemove = MoveHandlerIE;
}


function vec(X, Y)
{
    this.X = X;
    this.Y = Y;
}

// adds force in X and Y to spring for dot[i] on dot[j]
function springForce(i, j, spring)
{
    var dx = (dots[i].X - dots[j].X);
    var dy = (dots[i].Y - dots[j].Y);
    var len = Math.sqrt(dx*dx + dy*dy);
    if (len > SEGLEN) {
        var springF = SPRINGK * (len - SEGLEN);
        spring.X += (dx / len) * springF;
        spring.Y += (dy / len) * springF;
    }
}


function animate() {   
    // dots[0] follows the mouse,
    // though no dot is drawn there
    var start = 0;
    if (followmouse) {
        dots[0].X = Xpos;
        dots[0].Y = Ypos;   
        start = 1;
    }
   
    for (i = start ; i < nDots; i++ ) {
       
        var spring = new vec(0, 0);
        if (i > 0) {
            springForce(i-1, i, spring);
        }
        if (i < (nDots - 1)) {
            springForce(i+1, i, spring);
        }
       
        // air resisitance/friction
        var resist = new vec(-dots[i].dx * RESISTANCE,
            -dots[i].dy * RESISTANCE);
       
        // compute new accel, including gravity
        var accel = new vec((spring.X + resist.X)/MASS + XGRAVITY,
            (spring.Y + resist.Y)/ MASS + YGRAVITY);
       
        // compute new velocity
        dots[i].dx += (DELTAT * accel.X);
        dots[i].dy += (DELTAT * accel.Y);
       
        // stop dead so it doesn't jitter when nearly still
        if (Math.abs(dots[i].dx) < STOPVEL &&
            Math.abs(dots[i].dy) < STOPVEL &&
            Math.abs(accel.X) < STOPACC &&
            Math.abs(accel.Y) < STOPACC) {
            dots[i].dx = 0;
            dots[i].dy = 0;
        }
       
        // move to new position
        dots[i].X += dots[i].dx;
        dots[i].Y += dots[i].dy;
       
        // get size of window
        var height, width;
        if (isNetscape) {
            height = window.innerHeight + window.pageYOffset;
            width = window.innerWidth + window.pageXOffset;
        } else {   
            height = document.body.clientHeight + document.body.scrollTop;
            width = document.body.clientWidth + document.body.scrollLeft;
        }
       
        // bounce off 3 walls (leave ceiling open)
        if (dots[i].Y >=  height - DOTSIZE - 1) {
            if (dots[i].dy > 0) {
                dots[i].dy = BOUNCE * -dots[i].dy;
            }
            dots[i].Y = height - DOTSIZE - 1;
        }
        if (dots[i].X >= width - DOTSIZE) {
            if (dots[i].dx > 0) {
                dots[i].dx = BOUNCE * -dots[i].dx;
            }
            dots[i].X = width - DOTSIZE - 1;
        }
        if (dots[i].X < 0) {
            if (dots[i].dx < 0) {
                dots[i].dx = BOUNCE * -dots[i].dx;
            }
            dots[i].X = 0;
        }
       
        // move img to new position
        dots[i].obj.left = dots[i].X;         
        dots[i].obj.top =  dots[i].Y;      
    }
}

// end code hiding -->
</script>

<font face="Tahoma"><a target="_blank" href="http://www.htmlfreecodes.com/"><span style="font-size: 8pt; text-decoration: none">HTML Free Code</span></a></font>
Post12/29/2008 at 1:29pm (UTC)    
Post subject:

Search box to find texts on the pages

Code:
<!-- This Script is from www.htmlfreecodes.com, Coded by: Krishna Eydatoula-->
<SCRIPT language=JavaScript>
var NS4 = (document.layers);   
var IE4 = (document.all);
var win = window;   
var n   = 0;
function findInPage(str) {
  var txt, i, found;
  if (str == "")
    return false;
  if (NS4) {
    if (!win.find(str))
      while(win.find(str, false, true))
        n++;
    else
      n++;
    if (n == 0)
      alert("Not found.");
  }
  if (IE4) {
    txt = win.document.body.createTextRange();
    for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
      txt.moveStart("character", 1);
      txt.moveEnd("textedit");
    }
    if (found) {
      txt.moveStart("character", -1);
      txt.findText(str);
      txt.select();
      txt.scrollIntoView();
      n++;
    }
    else {
      if (n > 0) {
        n = 0;
        findInPage(str);
      }
      else
        alert("Sorry, we couldn't find.Try again");
   }
  }
  return false;
}
</SCRIPT>

<FORM name=search onsubmit="return findInPage(this.string.value);">
<P align=center><FONT size=3>
<INPUT
style="BORDER-RIGHT: #666666 1px solid; BORDER-TOP: #666666 1px solid; FONT-SIZE: 8pt; BORDER-LEFT: #666666 1px solid; BORDER-BOTTOM: #666666 1px solid"
onchange="n = 0;" size=16 name=string></FONT><BR><INPUT style="BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #ffffff 1px solid; FONT-SIZE: 8pt; BORDER-LEFT: #ffffff 1px solid; BORDER-BOTTOM: #ffffff 1px solid; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #aaaaaa" type=submit value=Search in page ><center><font size=2pt;><font family=Times New Roman;><b>

<font face="Tahoma"><a target="_blank" href="http://www.htmlfreecodes.com/"><span style="font-size: 8pt; text-decoration: none">HTML Free Code</span></a></font>
Post12/29/2008 at 1:29pm (UTC)    
Post subject:

Snow on the page

Code:
<!-- This Script is from www.htmlfreecodes.com, Coded by: Krishna Eydatoula-->
<script>
// Set the number of snowflakes (more than 30 - 40 not recommended)
var snowmax=35

// Set the colors for the snow. Add as many colors as you like
var snowcolor=new Array("#aaaacc","#ddddFF","#ccccDD")

// Set the fonts, that create the snowflakes. Add as many fonts as you like
var snowtype=new Array("Arial Black","Arial Narrow","Times","Comic Sans MS")

// Set the letter that creates your snowflake (recommended:*)
var snowletter="*"

// Set the speed of sinking (recommended values range from 0.3 to 2)
var sinkspeed=0.6

// Set the maximal-size of your snowflaxes
var snowmaxsize=22

// Set the minimal-size of your snowflaxes
var snowminsize=8

// Set the snowing-zone
// Set 1 for all-over-snowing, set 2 for left-side-snowing
// Set 3 for center-snowing, set 4 for right-side-snowing
var snowingzone=3

///////////////////////////////////////////////////////////////////////////
// CONFIGURATION ENDS HERE
///////////////////////////////////////////////////////////////////////////


// Do not edit below this line
var snow=new Array()
var marginbottom
var marginright
var timer
var i_snow=0
var x_mv=new Array();
var crds=new Array();
var lftrght=new Array();
var browserinfos=navigator.userAgent
var ie5=document.all&&document.getElementById&&!browserinfos.match(/Opera/)
var ns6=document.getElementById&&!document.all
var opera=browserinfos.match(/Opera/) 
var browserok=ie5||ns6||opera

function randommaker(range) {      
   rand=Math.floor(range*Math.random())
    return rand
}

function initsnow() {
   if (ie5 || opera) {
      marginbottom = document.body.clientHeight
      marginright = document.body.clientWidth
   }
   else if (ns6) {
      marginbottom = window.innerHeight
      marginright = window.innerWidth
   }
   var snowsizerange=snowmaxsize-snowminsize
   for (i=0;i<=snowmax;i++) {
      crds[i] = 0;                     
       lftrght[i] = Math.random()*15;         
       x_mv[i] = 0.03 + Math.random()/10;
      snow[i]=document.getElementById("s"+i)
      snow[i].style.fontFamily=snowtype[randommaker(snowtype.length)]
      snow[i].size=randommaker(snowsizerange)+snowminsize
      snow[i].style.fontSize=snow[i].size
      snow[i].style.color=snowcolor[randommaker(snowcolor.length)]
      snow[i].sink=sinkspeed*snow[i].size/5
      if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
      if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
      if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}
      if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}
      snow[i].posy=randommaker(2*marginbottom-marginbottom-2*snow[i].size)
      snow[i].style.left=snow[i].posx
      snow[i].style.top=snow[i].posy
   }
   movesnow()
}

function movesnow() {
   for (i=0;i<=snowmax;i++) {
      crds[i] += x_mv[i];
      snow[i].posy+=snow[i].sink
      snow[i].style.left=snow[i].posx+lftrght[i]*Math.sin(crds[i]);
      snow[i].style.top=snow[i].posy
      
      if (snow[i].posy>=marginbottom-2*snow[i].size || parseInt(snow[i].style.left)>(marginright-3*lftrght[i])){
         if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
         if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
         if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}
         if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}
         snow[i].posy=0
      }
   }
   var timer=setTimeout("movesnow()",50)
}

for (i=0;i<=snowmax;i++) {
   document.write("<span id='s"+i+"' style='position:absolute;top:-"+snowmaxsize+"'>"+snowletter+"</span>")
}
if (browserok) {
   window.onload=initsnow
}
</script>

<font face="Tahoma"><a target="_blank" href="http://www.htmlfreecodes.com/"><span style="font-size: 8pt; text-decoration: none">HTML Free Code</span></a></font>
Post12/29/2008 at 1:30pm (UTC)    
Post subject:

Rain on page

Code:
<!-- This Script is from www.htmlfreecodes.com, Coded by: Krishna Eydatoula-->

<body>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var no = 50;
var speed = 1;
var ns4up = (document.layers) ? 1 : 0;
var ie4up = (document.all) ? 1 : 0;
var s, x, y, sn, cs;
var a, r, cx, cy;
var i, doc_width = 800, doc_height = 600;
if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
else
if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
x = new Array();
y = new Array();
r = new Array();
cx = new Array();
cy = new Array();
s = 8;
for (i = 0; i < no; ++ i) {
initRain();
if (ns4up) {
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"1\" ");
document.write("top=\"1\" visibility=\"show\"><font color=\"blue\">");
document.write(",</font></layer>");
}
else {
document.write("<layer name=\"dot"+ i +"\" left=\"1\" ");
document.write("top=\"1\" visibility=\"show\"><font color=\"blue\">");
document.write(",</font></layer>");
   }
}
else
if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"blue\">");
document.write(",</font></div>");
}
else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"blue\">");
document.write(",</font></div>");
      }
   }
}
function initRain() {
a = 6;
r[i] = 1;
sn = Math.sin(a);
cs = Math.cos(a);
cx[i] = Math.random() * doc_width + 1;
cy[i] = Math.random() * doc_height + 1;
x[i] = r[i] * sn + cx[i];
y[i] = cy[i];
}
function makeRain() {
r[i] = 1;
cx[i] = Math.random() * doc_width + 1;
cy[i] = 1;
x[i] = r[i] * sn + cx[i];
y[i] = r[i] * cs + cy[i];
}
function updateRain() {
r[i] += s;
x[i] = r[i] * sn + cx[i];
y[i] = r[i] * cs + cy[i];
}
function raindropNS() {
for (i = 0; i < no; ++ i) {
updateRain();
if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) {
makeRain();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
document.layers["dot"+i].top = y[i];
document.layers["dot"+i].left = x[i];
}
setTimeout("raindropNS()", speed);
}
function raindropIE() {
for (i = 0; i < no; ++ i) {
updateRain();
if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) {
makeRain();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
document.all["dot"+i].style.pixelTop = y[i];
document.all["dot"+i].style.pixelLeft = x[i];
}
setTimeout("raindropIE()", speed);
}
if (ns4up) {
raindropNS();
}
else
if (ie4up) {
raindropIE();
}
//  End -->
</script>


<font face="Tahoma"><a target="_blank" href="http://www.htmlfreecodes.com/"><span style="font-size: 8pt; text-decoration: none">HTML Free Code</span></a></font>
Display posts from previous:   


Powered by phpBB © 2001, 2005 phpBB Group