PDA

View Full Version : Watermark Background Image Script Not Working



egghead2000
04-06-2008, 10:18 PM
I've used this script before and its always worked fine, but not this time. Has it changed?
http://www.noahsvideo.com/PELUSOhistory.htm
Thanks

Nile
04-07-2008, 12:19 AM
What script?

egghead2000
04-07-2008, 04:23 AM
The DD script for the Watermark Background Image

<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('notebook.jpg') white center no-repeat fixed"

</script>

rangana
04-07-2008, 04:37 AM
Hi egghead2000,

It's working :)

Apparently, you just have to note that you set your td background to #F7EA92

...It covers the image. You might wish to remove your bgcolor attribute in your last <td> ;)

...Also place your JS in the head section, not in the body :)

...Also, have you consider the point that when the user disabled their Javascript?..then your image in the center will not be shown.

...This script from DD, also has a CSS counterpart:


<style type="text/css">
body{background:url('pm.gif') white center no-repeat fixed;}
</style>


See if it helps ;)

egghead2000
04-07-2008, 03:40 PM
Thanks, I tried the above and can see the image for a split second as the page loads. Then it is covered again. I've got to get to work and will try again this evening.
Thanks again

egghead2000
04-07-2008, 06:09 PM
Thanks, but I'm still having problems
Hi egghead2000,

It's working :)

Apparently, you just have to note that you set your td background to #F7EA92

...It covers the image. You might wish to remove your bgcolor attribute in your last <td> ;)

...Also place your JS in the head section, not in the body :)

...Also, have you consider the point that when the user disabled their Javascript?..then your image in the center will not be shown.

...This script from DD, also has a CSS counterpart:


<style type="text/css">
body{background:url('pm.gif') white center no-repeat fixed;}
</style>


See if it helps ;)

egghead2000
04-08-2008, 12:00 AM
I guess this watermark script doesn't work with any bgcolor. As soon as I use a page color or table color it covers the watermark. Is there a way to put the watermark on top of the bgcolor so it shows?

rangana
04-08-2008, 01:48 AM
Change the color from,


background:url('pm.gif') white center no-repeat fixed;


to #F7EA92.

....and remove the bgcolor declaration in your td's.
See if it helps :)

egghead2000
04-08-2008, 02:23 AM
Thank you again, its working!!!!!!
Change the color from,


background:url('pm.gif') white center no-repeat fixed;


to #F7EA92.

....and remove the bgcolor declaration in your td's.
See if it helps :)

egghead2000
04-08-2008, 05:37 AM
Well, I thought I had it. The color I put with the watermark script turns the entire page that color. Is it possible to have the page background one color and the table background another color and have the water mark show through. Please see the following example.

www.noahsvideo.com/pt.htm

I'm trying t0 do this page with a water mark.

www.noahsvideo.com/pelusohistory.htm

Thanks

rangana
04-10-2008, 01:32 AM
Have you tried making it a background on the td instead?

...Use either the CSS or JS..