ForgotPassword?
Sign Up
Search this Topic:
Forum Jump
Posts: 414
Sep 30 07 12:52 PM
Suggestions Board Regular
Quote:attempt by man to harness the power of ancient dragons
Quote:built by Silph Co.
Posts: 3640
Sep 30 07 1:07 PM
Suggestions Board Manager
Posts: 183
Sep 30 07 1:29 PM
Posts: 2573
Sep 30 07 3:40 PM
Sep 30 07 6:23 PM
Posts: 7573
Oct 1 07 7:51 AM
PF Executive
Posts: 0
Oct 1 07 4:19 PM
Oct 2 07 5:28 AM
Posts: 2646
Oct 2 07 6:21 AM
Pokémon Factory VIP
The easiest way to demonstrate is with Shinies, since it's a true or false thing (this is called a boolean). You'll have to remove the spaces from the < script > bits and the < ! - - bits: < script type="text/javascript" >< ! - -function shinycheck(IDnum) { var shinerate = 10;// Change the number above to change the rate of Shiny appearances.// Each dex has a 1-in-shinerate chance of being shiny; default is 1 in 10, or 10%. var shinevalue = Math.floor(Math.random()*shinerate);// ^ this multiplies 10 by a random number (Math.random) between 0 and 1, effectively making it 0-9. The Math.floor bit rounds it down - you need this. It turns all this into a value called shinevalue. if (shinevalue == 0) { document.write("<img src=" + IDnum + "s.gif>") ;// If shinevalue is 0, it adds and s to the filename - PF's shinies are numbered like 112s.gif. } else { document.write("<img src=" + IDnum + ".gif>") ;// and if it's not 0, it displays the normal image without the s. }}// - - >< /script >All that should go within the < html > tags but outside the < body > tags.Where you want to display the image (inside < body > tags):< script type="text/javascript" >< ! - -shinycheck("016");// - - >< /script >< noscript ><img src=016.gif>< /noscript >The javascript calls the shinycheck function - that's what is above. If the person viewing the page doesn't have javascript active on their browser, the < noscript > tags display the image on its own.Feel free to ask if you have any more questions about this. I wrote this all in [ code ] tags because ezboard doesn't like people putting scripts on their forums.
Oct 2 07 6:41 PM
Apr 3 08 4:42 PM
Posts: 967
Apr 3 08 7:18 PM
Posts: 3097
Apr 3 08 7:47 PM
Apr 4 08 1:34 AM
Apr 20 08 8:05 PM
Apr 21 08 3:39 AM
Jul 8 08 5:31 PM
Posts: 1491
Jul 9 08 2:41 AM
Jul 9 08 8:37 AM
Jul 9 08 10:07 AM
Share This