|
Posted by Andrew Bailey on 08/04/07 10:21
"David Dorward" <dorward@gmail.com> wrote in message
news:1186155608.059646.143120@q75g2000hsh.googlegroups.com...
> On Aug 3, 2:26 pm, Bob <Go1...@Yahoo.Com> wrote:
>
>> I havea link with a href of javascript:window.print()
>> it works fine except that it prints the 'Print' link itself......
>
> And except that it doesn't work when JavaScript isn't available and is
> a dead link instead.
>
> And except that it produces a new and unexpected UI control for
> something that the typical browser already presents the user with
> several ways of doing (File > Print, Ctrl+P, a print button in a
> toolbar, etc).
>
> It is pointless. It doesn't allow users to do anything they couldn't
> do before, breaks in some cases, and wastes screen space and
> bandwidth.
>
>> anybody know how I can supress printing the link?
>
> Best way - get rid of it. Otherwise set up a print media stylesheet.
>
> --
> David Dorward
> http://dorward.me.uk/
> http://blog.dorward.me.uk/
>
Hi David,
The HTML Police will probably moan but this is how I do it...
<html>
<head>
<title>Test Page</title>
</head>
<script language="JavaScript" type="text/javascript">
<!-- HIDE PRINT BUTTON
function hideprintbutton(){
printon.style.display='none';
printoff.style.display='inline';
}
function showprintbutton(){
printoff.style.display='none';
printon.style.display='inline';
}
// - End of JavaScript - -->
</script>
<body onclick="showprintbutton()">
<span id="printon" style="display: inline"><a href="javascript:
hideprintbutton(); window.print()" title="Click here to PRINT this page"
hidefocus><img src="../images/input/print_button.gif" width="80" height="80"
border="0"></a></span>
<span id="printoff" style="display: none"><img
src="../images/input/print_button_mask.gif" width="80" height="80"
title="Click anywhere to restore the PRINT button"></span>
</body>
</html>
Hope this helps
Andy
Navigation:
[Reply to this message]
|