Click to See Complete Forum and Search --> : Window Manipulation


stevesee
03-28-2003, 09:11 PM
I have a site that uses flash in a layer with a transparent bgd and when I try to print all I get is a black box where the transparent background of flash is. I haven't found a solution for this so I'm trying to come up with a work around. I want to have some code that will, from the page you are on do the following:

1. When you click on a print icon/button have it open a new window of the page you are on
2. Hide the layer the flash is in, in the new window created in step 1.
3. Bring up a print dialog.

I'm pretty sure this could be done with javascript fairly easily but I'm not well versed in javascript yet.

So obviously we need a window.open but what is the parameter to open a copy of whatever page you are currently viewing?

Also since I need to talk to a layer called "nav" in the new window to hide it I will need to name the new window something.

Is it possible to put all of these items into a function and call it when the button is clicked?

stevesee
03-28-2003, 10:03 PM
Thanks that is working well in IE but not in Netscape 7.2

It will open the new window but not hide the layer. I'm assuming it's just a netscape syntax thing. Any ideas?

Thanks in advance,
S

stevesee
03-28-2003, 10:07 PM
Here is my DIV tag for the layer

<div id="nav" style="position:absolute; left:0px; top:68px; width:775px; height:275px; z-index:10; visibility: visible;">

stevesee
03-30-2003, 08:27 PM
OK I ran into some problems once I posted it to the web. For some reason it is not functioning properly. I made some changes and decided on a slightly new way to do it which might work better. Here is what I have now:

function openPrintable() {
document.getElementById("nav").style.visibility = "hidden";
print();
document.focus();
document.getElementById("nav").style.visibility = "visable";
}

All I really need it to do is when the function is called, hide the layer, bring up the print dialog and once they have clicked on print or cancel to then show the layer again. What I have doesn't seem to work and I'm assuming it is because I can't tell once the print dialog is gone.

Any help is appreciated. :)

S

stevesee
03-31-2003, 12:59 PM
You can keep a layer from printing using CSS? If that is the case then that would solve my problem. Do you know where I can find the code for this?

Thanks again,
S

stevesee
03-31-2003, 01:20 PM
Ok I found some code in the CSS forum:

<style media="print" type="text/css">
.noprint {display:none;}
</style>

This appears to work in IE, haven't tested in Netscape yet. Thanks for your help. :)