printer icon not to be printed

Results 1 to 2 of 2

Thread: printer icon not to be printed

  1. #1
    Join Date
    Dec 1969

    Default printer icon not to be printed

    Hi All, <BR><BR>I found a cool script which on double click on page pops up a printer icon, which then is used to print... <BR><BR>Now the problem is that when we choose to print...even the icon is printed along with the page. <BR><BR>Is there some way we can make this printer icon to disappear after its being clicked, or somehow so that the printer icon is not printed. <BR><BR>Thanks in Advance <BR><BR>Cheers <BR><BR>Jay <BR><BR><BR>I am using the following script. <BR><BR>&#060;!-- using at the head section of the page --&#062; <BR>script&#062; <BR>&#060;!-- <BR>var showmenu=1 <BR><BR>if (document.layers) { <BR>document.captureEvents(Event.ONDBLCLICK); <BR>} <BR>document.ondblclick=dblclick; <BR><BR>if (document.layers){ <BR> document.captureEvents(Event.MOUSEMOVE); <BR>} <BR>document.onmousemove = handlerMM; <BR><BR>function handlerMM(e){ <BR> x = (document.layers) ? e.pageX : event.clientX <BR> y = (document.layers) ? e.pageY : event.clientY <BR>} <BR><BR>function dblclick() { <BR> if (document.all && showmenu==1) { <BR> <BR> <BR> <BR> } <BR> if (document.layers && showmenu==1) { <BR> document.printpic.left=x <BR> document.printpic.left=x <BR> <BR> } <BR> if (document.all && showmenu!=1) { <BR> <BR> } <BR> if (document.layers && showmenu!=1) { <BR> document.printpic.left=x-10000 <BR> } <BR> showmenu=showmenu*-1 <BR>} <BR>// --&#062; <BR>&#060;/script&#062; <BR><BR><BR>&#060;!-- using at the end of the body section --&#062; <BR><BR>&#060;div id="printpic" style="LEFT: -10000px; VISIBILITY: visible; POSITION: absolute; TOP: 20px"&#062; <BR>&#060;A onclick=window.print() href="#"&#062;&#060;IMG style="WIDTH: 58px; HEIGHT: 53px" alt ="print this page" src="../images/printicon.gif" border=0 &#062; &#060;/a&#062; <BR><BR>&#060;/div&#062;

  2. #2
    Join Date
    Dec 1969

    Default Use a cascading style sheets...

    ...for print. In this style sheet create a new class - lets call it "printer_icon" - and set its display property to none:<BR><BR>&#060;style type="text/css" media="print"&#062;<BR>.printer_icon { display: none }<BR>&#060;/style&#062;<BR><BR>No assign this class to your printer icon:<BR><BR>&#060;img class="printer_icon" ...&#062;<BR><BR>Now it should not be printed.<BR><BR>Oliver.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts