Show Me Please!, it isnot run |
||
Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.
In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.
Zymic Webmaster Forums Zymic.com Support Zymic Free Web Templates |
||
![]() |
Show Me Please!, it isnot run |
||
Aug 18 2009, 05:03 AM
Post
#1
|
|
|
Newbie ![]() Group: Members Posts: 5 Joined: 18-August 09 Member No.: 106,858 |
var snowflake = "25.gif"; var ns4up = (document.layers) ? 1 : 0; var ie4up = (document.all) ? 1 : 0; var dx, xp, yp; var am, stx, sty; var i, doc_width = 100, doc_height = 50; if (ns4up) { doc_width = self.innerWidth; doc_height = self.innerHeight; } else if (ie4up) { 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-25); yp[i] = Math.random()*doc_height; am[i] = Math.random()*10; stx[i] = 0.01 + Math.random()/5; sty[i] = 0.3 + Math.random(); if (ns4up) { if (i == 0) { document.write("<layer name="dot"+ i +"" left="5" "); document.write("top="5" visibility="show"><img src=""); document.write(snowflake + "" border="0"></layer>"); } else { document.write("<layer name="dot"+ i +"" left="5" "); document.write("top="5" visibility="show"><img src=""); document.write(snowflake + "" border="0"></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: 7px; LEFT: 7px;"><img src=""); document.write(snowflake + "" border="0"></div>"); } else { document.write("<div id="dot"+ i +"" style="POSITION: "); document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: "); document.write("visible; TOP: 7px; LEFT: 7px;"><img src=""); document.write(snowflake + "" border="0"></div>"); } } } function snowNS() { for (i = 0; i < no; ++ i) { yp[i] += sty[i]; if (yp[i] > doc_height-25) { xp[i] = Math.random()*(doc_width-am[i]-15); yp[i] = 0; stx[i] = 0.01 + Math.random()/5; sty[i] = 0.3 + Math.random(); doc_width = self.innerWidth; doc_height = self.innerHeight; } dx[i] += stx[i]; document.layers["dot"+i].top = yp[i]; document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]); } setTimeout("snowNS()", speed); } function snowIE() { for (i = 0; i < no; ++ i) { yp[i] += sty[i]; if (yp[i] > doc_height-25) { xp[i] = Math.random()*(doc_width-am[i]-15); yp[i] = 0; stx[i] = 0.01 + Math.random()/5; sty[i] = 0.3 + Math.random(); doc_width = document.body.clientWidth; doc_height = document.body.clientHeight; } dx[i] += stx[i]; document.all["dot"+i].style.pixelTop = yp[i]; document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]); } setTimeout("snowIE()", speed); } if (ns4up) { snowNS(); } else if (ie4up) { snowIE(); } // End --> </script>
Attached File(s)
|
|
|
Aug 18 2009, 09:49 AM
Post
#2
|
|
![]() Outrageously Uber Ninja ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Moderators Posts: 5,140 Joined: 11-May 08 From: Australia Member No.: 25,876 |
Are you actually able to explain what you are attempting here?
|
|
|
Aug 18 2009, 11:11 AM
Post
#3
|
|
![]() Marvellous Ninja ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 568 Joined: 10-May 09 From: Wisconsin state, United States of America Member No.: 94,482 |
Hi tomluxi,
Snowflakes huh! Pretty cool javascript you ran across here (biggest thing to remember here is that the graphic that produces the snowflake is hotlinked back to an external website other than your own - so you might want to consider creating your own snowflake graphic for your own website to draw upon internally). Don't forget to leave the original author in the script as a credit to the creator (hate to think of plagerism) if the script was signed - as this one was. You simply forgot to place the javascript in the <body> of a complete html structured webpage. You can view (or copy) a working basic format from here. Good luck and Think Snow! |
|
|
Aug 21 2009, 09:52 AM
Post
#4
|
|
|
Newbie ![]() Group: Members Posts: 5 Joined: 18-August 09 Member No.: 106,858 |
Hi tomluxi, Snowflakes huh! Pretty cool javascript you ran across here (biggest thing to remember here is that the graphic that produces the snowflake is hotlinked back to an external website other than your own - so you might want to consider creating your own snowflake graphic for your own website to draw upon internally). Don't forget to leave the original author in the script as a credit to the creator (hate to think of plagerism) if the script was signed - as this one was. You simply forgot to place the javascript in the <body> of a complete html structured webpage. You can view (or copy) a working basic format from here. Good luck and Think Snow! thank so much! but it isnot run on "vndv" i don't know why? please tell clearly... |
|
|
Aug 22 2009, 10:09 PM
Post
#5
|
|
![]() Marvellous Ninja ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 568 Joined: 10-May 09 From: Wisconsin state, United States of America Member No.: 94,482 |
Hi tomluxi.
I've discovered two DOCUMENT TYPE Declaration(s) that this code appears likes to run under are non-declared and CODE <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>SnowFlakes</title> <!-- author: Douglas (ZPCS) --> <!-- Created: AUGUST 17, 2009 --> <!-- Modified: AUGUST 19, 2009 (ZPCS) --> <!-- Validated HTML 4.01 19AUG09: http://validator.w3.org/#validate_by_uri+with_options --> </head> <body> <script type="text/javascript" src="../snowflake.js"> </script> <p> <a href="http://validator.w3.org/check?uri=referer"> <img src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01 Strict" height="31" width="88"> </a> </p> </body> </html> The working javascript coding has been placed in a javascript file "snowflake.js" and then called from the "body" Some created javascripts just don't play well with others unless you've take the time to re-work them. There could be any to a great numeric multitude of reasons it doesn't work outside the basic script. Have a view ... zpcs
|
|
|
Aug 23 2009, 08:10 AM
Post
#6
|
|
|
Newbie ![]() Group: Members Posts: 5 Joined: 18-August 09 Member No.: 106,858 |
|
|
|
![]() |
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users) |
||
| 0 Members: | ||
Forum Jump |
||
| Lo-Fi Version | Time is now: 19th May 2013 - 03:36 PM |