I'm hiding the background image from the printer using the onBeforePrint attribute in IE 5+. This works fine, but I'm somehow flubbing up the syntax when trying to put the background image back in onAfterPrint. Do any of you guys see what I've done wrong?
I can make it work by just reloading the window, but that kinda sucks since the user has gotten to this page via a form, so there is a box that comes up an tells them that the page cannot be refreshed without resubmitting the values etc... It's just an extra click I'd like to eliminate. Kevin
slanek@ssd.fsi.com
Code:
<LINK REL="STYLESHEET" TYPE="text/css" HREF="eac_style.css">
<SCRIPT LANGUAGE="JavaScript">
function removebackground()
{
//Set the document's background image to null
document.body.style.background=''
}
function revertback()
{
//Put the image back
document.body.style.background='background_1.gif'
}
window.onbeforeprint=removebackground
window.onafterprint=revertback
</SCRIPT>
I can make it work by just reloading the window, but that kinda sucks since the user has gotten to this page via a form, so there is a box that comes up an tells them that the page cannot be refreshed without resubmitting the values etc... It's just an extra click I'd like to eliminate. Kevin
slanek@ssd.fsi.com