I have made a small script to change the background color of my VF page. Here's my script
<script language="JavaScript">
function changeBGC(color){
document.bgColor = color;
}
And here's in the VF..
<h4>Change the Background Color</h4>
<a href="#" onClick="javascript:changeBGC('#CCFFFF')">
<b><font color='#000099'>Blue</font></b>
</a><br />
It's working fine, but I was wondering if I could add a link to a static resource to use to to change the background to an Image? Here's what I tried…
function change2Image(){
document.background=url"{!$Resource.bluebg}";
}
//bluebg.jpeg is static resource
Any help will be appreciated.
Best Answer
I haven't try like that earlier. But it'll work something like,
Things to Note
bluebg
should be directly an image, not a zip.iframe
within the outer webpage. So you need to identify which background you need to change if you are talking about document background.