JavaScript - Change BG Image


[ Follow Ups ] [ Post Followup ] [ Member's Chat ]

Posted by alain on October 29, 1999 at 04:06:58

Previous Message: JAVASCRIPT HELP posted by James

function setBG(loc){
switch (loc){
case "http://ent.ebc.com.au/":
document.backgroundImage="ent.ebc.com.au/generic_pics/tile_background.gif";
break;
case "http://ent.ebc.com.au/direct_links/cba/":
document.backgroundImage="ent.ebc.com.au/generic_pics/cba_tile.gif";
break;
default: alert("Other entry");
}
}


I wrote this code to change the background pic depending on the url of the frames page. Believe me it was neccessary. The code works except that it won't change the background pic. It changes the bgColor no problem. How do you change a BG Pic from within a script????

Followups:



Post a Followup

Name:

E-Mail:

Subject:

Comments:

Optional Home Page Link (URL):

Home Page Title:


[ Follow Ups ] [ Post Followup ] [ Member's Chat ]