Forum Moderators: open

Message Too Old, No Replies

image problem

         

Simone100

4:43 am on Sep 19, 2007 (gmt 0)

10+ Year Member



Hello, found this from website wisdom, but when its used it puts many images all over the background of the screen. How to get it to only show one background image instead of several? Please let me know, thanks very much.

<script language="javascript" type="text/javascript">
<!--
//Retrieved from Website Wisdom <http://www.example.com>
function doBack(){
var theday=new Date();
var nday=theday.getDay();
var imgs=new Array();
imgs[0]="sunday.gif";//Background Image for Sunday
imgs="monday.gif";//Background Image for Monday
imgs[2]="tuesday.gif";//Background Image for Tuesday
imgs[3]="wednesday.gif";//Background Image for Wednesday
imgs[4]="thursday.gif";//Background Image for Thursday
imgs[5]="friday.gif";//Background Image for Friday
imgs[6]="saturday.gif";//Background Image for Saturday
document.body.background=imgs[nday]
}
//-->
</script>
this to the BODY of the document...
<script language="javascript" type="text/javascript">
<!--
doBack();
//-->
</script>

[1][edited by: engine at 1:04 pm (utc) on Sep. 19, 2007]
[edit reason] examplified [/edit]

SpeedLimit

5:18 am on Sep 19, 2007 (gmt 0)

10+ Year Member



I can't help you in coding, but I thought I can give you an advise if you are using Dreamweaver in developing the web pages. If so there is an extension that you can download and use for free, which will generate the code for you. All you need to do is upload the images or even just choosing the folder that contain them.

I can't remember the name or the link but if this will be a big help to you, I can look for it and tell you about it.

Best

Speed

daveVk

6:27 am on Sep 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try replace

document.body.background=imgs[nday]

with

document.body.style.background='beige url(' + imgs[nday] + ') no-repeat top center';