[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

onafterprint in Netscape

Posted on 2002-07-11
3
Medium Priority
?
202 Views
Last Modified: 2010-05-18
What I want to do is hide several elements of a page, print the page, then have the elements come back.  Code below.  Unfortunately, the elements come back before the user clicks Print.  I understand that I can fix that in IE 5.5, but I need a solution in Netscape 7.  Anyone know of a way to detect if the user has clicked Print?


     function ReturnTheButtons() {
          document.getElementById('CloseButtonTop').style.visibility = 'visible';
          document.getElementById('CloseButtonBottom').style.visibility = 'visible';
     }
     function PrintThisWindow() {
          document.getElementById('ClickToPrint').style.visibility = 'hidden';
          document.getElementById('InstructionText').style.visibility = 'hidden';
          document.getElementById('CloseButtonTop').style.visibility = 'hidden';
          document.getElementById('CloseButtonBottom').style.visibility = 'hidden';
          window.print();    
          ReturnTheButtons();
     }
0
Comment
Question by:DanR
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
CJ_S earned 200 total points
ID: 7148738
I know that Netscape 4 prints the page the way it looks when it initially loads. So even when you hide a certain element / layer and print then it will show.

I think this is also the case with Netscape 7. Try to keep the elements hidden when you load the page. Then after loading is complete you show them:

So make those elements hidden when the page loads, and add the following code:

function document_onload()
{
  // show elements here
}
window.onload=document_onload;

0
 
LVL 3

Author Comment

by:DanR
ID: 7148960
Well, I may check that out, but for now, it looks like I'm going to have separate styles for screen and print.

But hey, you tried and I can't remember how to delete a question, so take the points.
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 7148966
Most generous! Thank you!

If you need additional help on this. Post it here :-)

CJ
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question