Print page button

R

RnR Ron

Hi all,
I have created a site with suppressed browser toolbars and address bars
which looks great with more real estate to work with but now need a way to
print the page besides the right mouse button click access to print page
command. I have a cross browser script (below) to created a print screen
button but it looks so generic and doesn't fit the page style at all. My
question is: How can I alter this cross browser print screen script or in
any other way display a button with either a color, a transparant
background, or a graphic background so it blends better into a page with a
graphic background? The script I have is:

Thanks very much in advance for your imput and advice,
Rock 'n' Roll Ron


<SCRIPT Language="Javascript">

function printit(){
if (window.print) {
window.print() ;
} else {
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0
CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box
WebBrowser1.outerHTML = "";
}
}
</script>

<SCRIPT Language="Javascript">
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
if (VERSION > 3) {
document.write('<form><input type=button value="Print Page" name="Print"
onClick="printit()"></form>');
}
</script>
 
S

Stefan B Rusynko

Just create an image w/ a hyperlink and apply the onclick event to it (onClick="printit()")
or the scriot function call
<a href="javascript:printit();">image here</a>


--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Hi all,
| I have created a site with suppressed browser toolbars and address bars
| which looks great with more real estate to work with but now need a way to
| print the page besides the right mouse button click access to print page
| command. I have a cross browser script (below) to created a print screen
| button but it looks so generic and doesn't fit the page style at all. My
| question is: How can I alter this cross browser print screen script or in
| any other way display a button with either a color, a transparant
| background, or a graphic background so it blends better into a page with a
| graphic background? The script I have is:
|
| Thanks very much in advance for your imput and advice,
| Rock 'n' Roll Ron
|
|
| <SCRIPT Language="Javascript">
|
| function printit(){
| if (window.print) {
| window.print() ;
| } else {
| var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0
| CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
| document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
| WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box
| WebBrowser1.outerHTML = "";
| }
| }
| </script>
|
| <SCRIPT Language="Javascript">
| var NS = (navigator.appName == "Netscape");
| var VERSION = parseInt(navigator.appVersion);
| if (VERSION > 3) {
| document.write('<form><input type=button value="Print Page" name="Print"
| onClick="printit()"></form>');
| }
| </script>
|
|
 
P

P@tty Ayers

You have some good responses on your crosspost on
microsoft.public.frontpage.client.
 
R

RnR Ron

Many thanks to all who were kind enough to post a helpful idea. Your
generosity is always appreciated.

Warmest Regards,
Rock 'n' Roll Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top