PDA

View Full Version : Can anyone work this background image script so it doesn't disappear on refresh.



poshrat
11-03-2008, 05:17 PM
Here is the Dynamic Drive script but when you refresh the page is goes white.

When you navagate the buttons the background stays but I can't work it out.



<script language="JavaScript1.2">

/*
Watermark Backgound Image Script- Dynamic Drive (www.dynamicdrive.com)
For full source code, 100's more DHTML scripts, and TOS,
visit dynamicdrive.com
*/

if (document.all||document.getElementById)
document.body.style.background="url('http://images40.fotki.com/v1336/fileFFqQ/bd18f/9/945583/6882229/Sunflower.gif') white center no-repeat fixed"

</script> </html>

jscheuer1
11-03-2008, 06:28 PM
There is no:


http://images40.fotki.com/v1336/fileFFqQ/bd18f/9/945583/6882229/Sunflower.gif

There could also be other problems.

jscheuer1
11-03-2008, 08:17 PM
I really don't know anything about "insert code in a box". But that doesn't change the fact that there is no file:


http://images40.fotki.com/v1336/fileFFqQ/bd18f/9/945583/6882229/Sunflower.gif

You must use a valid image file for this script to have any chance of working. If it would be easier, you could skip the script (it's really unnecessary anyway) and just use style:


body {
background:url('notebook.jpg') white center no-repeat fixed;
}

Change the notebook.jpg to a valid image file and place the above rule in an active stylesheet. Make sure it comes after any other background style for body.

poshrat
11-03-2008, 09:30 PM
Thankyou John, That did it thankyou.


I really don't know anything about "insert code in a box was how users put their code in a box like you have to give examples.

Thankyou again.

jscheuer1
11-03-2008, 10:51 PM
Glad it's working. I actually do know about putting code in a box, I just didn't understand what you were asking about. Just put:



code goes here


tags around your code so that it looks like so:


code goes here