Page 1 of 1

Random BG Colour BBCode

Posted: 06 Mar 2010, 08:49
by BBCode Bot
Random BG Colour BBCode

Author: Stoker
Description: The Random BG Colour BBCode makes the background color change every time the page is visited.
You can configure the script to change the colours.
Image

BBCode:

Code: Select all

[rbg][/rbg]
HTML:

Code: Select all

<script type="text/javascript">

/*Random background color- by javascriptkit.com
Visit JavaScript Kit (http://javascriptkit.com) for script
Credit must stay intact for use .**. */

//Enter list of bgcolors:
var bgcolorlist=new Array("#000000", "#800000", "#0000BF", "#008000", "#FF8000", "#FF80BF", "#00BFFF", "#FFFF00")

document.body.style.background=bgcolorlist[Math.floor(Math.random()*bgcolorlist.length)]
</script>
Helpline:

Code: Select all

Rbg: [rbg][/rbg]
Example:

Code: Select all

[rbg][/rbg]
Demo:
This topic
[rbg][/rbg]