Real Estate Forums
| Coding HTML, ASP, PHP, JAVA MYSQL and more. All coding questions should be asked here. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
||||
|
it snows in Florida at Xmas? I thought your Xmas would be like ours...
|
|
||||
|
This is shorter and should work with all browsers. I hope.
![]() Code:
<script type="text/javascript">
var snowsrc = "snehova-vlocka.gif" // source of snowflake
var no = 6; // no. of snowflakes
var doc_width, doc_height;
if (window.innerWidth || window.innerHeight)//opera Netscape 6 Netscape 4x Mozilla
{
doc_width = window.innerWidth;
doc_height = window.innerHeight;
}
if (document.body.clientWidth || document.body.clientHeight)//IE Mozilla
{
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
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() * (doc_width - 50);
yp[i] = Math.random() * doc_height;
am[i] = Math.random() * 20;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
document.write("<div id='dot"+ i +"' style='POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;'><img src='"+snowsrc+"' border='0'></div>");
}
function snow(doc_width, doc_height)
{
for (i = 0; i < no; ++ i)
{
sflake = new Array();
sflake[i] = document.getElementById('dot'+i); // getting all snowflakes
yp[i] += sty[i];
if ( yp[i] > doc_height - 50 )
{
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
}
dx[i] += stx[i];
sflake[i].style.top = yp[i] + 'px';
sflake[i].style.left = xp[i] + am[i] * Math.sin(dx[i]) + 'px';
}
setTimeout("snow(doc_width, doc_height)", 20);
}
snow(doc_width, doc_height);
</script>
__________________
Vlado Tovarnak "The more I want to get something done, the less I call it work." "In order to win, you must expect to win." by RICHARD BACH http://www.ValuesGuide.com is now producing and providing leads for real estate agents |
|
||||
|
Quote:
![]() |
|
||||
|
Nice Script.
![]() Vlado, that worked fine in IE6, Netscape 7.2, Opera 7.5, and Firefox.
__________________
AspenwoodMobileHomes.com - Mobile Homes For Sale - Aspenwood Mobile Homes SalesPractice.com -The Definitive Source for Sales Education on the Internet. - Sales Training MHAmerica.com - National Database of Mobile Homes For Sale Across America! - Mobile Homes For Sale |
|
||||
|
Way cool!
I wanted to do something, but didn't want to turn into a "Christmas" template... Thank you... Thank you... PS... Kyle... You should put a lit-up palm tree on your site, like the Corona commercial! That's always cool! Last edited by CafeMonkey; 12-13-2004 at 06:04 AM. |
|
||||
|
Quote:
Kyle |
|
||||
|
Quote:
|
|
||||
|
Funky looking in what way? In what browser?
I just copied the script as he put it up, and copied the snowflake file. |
|
||||
|
That does look a little different. Check out how the snowflakes float down the page on Kyle's site.
On your page the snowflakes stop right after they start giving the impression of "blinking."
__________________
AspenwoodMobileHomes.com - Mobile Homes For Sale - Aspenwood Mobile Homes SalesPractice.com -The Definitive Source for Sales Education on the Internet. - Sales Training MHAmerica.com - National Database of Mobile Homes For Sale Across America! - Mobile Homes For Sale |
![]() |
| Thread Tools | |
| Display Modes | |
|
|