Hello! I just started using BlueVoda and I love it! I have been working on a personal web site for a couple of nights now and I was think how neat it would be to have a random image background every time someone came to my site. anyways I can't seem to get this script to work! I am not sure how it would anyway since the only way you can edit the background is in page proprieties.. its late and I have been working for hours so - tell me if you have any tips to help me figure this out...
<script>
/*Random Background Image-
By JavaScript Kit (www.javascriptkit.com)
More free JavaScripts here!
*/
var backgr1="../images/bg1.jpg"
var backgr2="../images/bg2.jpg"
var backgr3="../images/bg3.jpg"
var cur=Math.round(6*Math.random())
if (cur<=1)
backgr=bg1
else if (cur<=4)
backgr=bg2
else
backgr=bg3
document.write('<body background="'+backgr+'"')
</script>
<script>
/*Random Background Image-
By JavaScript Kit (www.javascriptkit.com)
More free JavaScripts here!
*/
var backgr1="../images/bg1.jpg"
var backgr2="../images/bg2.jpg"
var backgr3="../images/bg3.jpg"
var cur=Math.round(6*Math.random())
if (cur<=1)
backgr=bg1
else if (cur<=4)
backgr=bg2
else
backgr=bg3
document.write('<body background="'+backgr+'"')
</script>
Comment