PDA

View Full Version : When you click a Link it opens a specific sized pop up



Jonny
07-08-2006, 08:08 PM
What i want it to do is when you click say 'Printable Version' it opens up a Pop-Up box with a specific sized box, Say like 60 x 110. Then people can print the page.

Anyone know the script or a link ?

Cheers alot, Jonny

jscheuer1
07-11-2006, 07:42 AM
Well, I would think that you would also want non-javascript enabled browsers to be able to print the page and not want to require your users (with or without javascript) to click a link to get another page for printing. So, you might want to look into using a stylesheet that reformats the original page when printed, making it printer friendly.

But, to answer your question in javascript, you would use the window.open() method. You can Google to find all the various parameters available for window.open() but, a good way for what you are talking about would be:


<a href="printable.htm" onclick="window.open(this.href,'_blank','menubar=1, scrollbars=1, resizeable=1, width=60, height=110');return false;" target="_blank">Printer Friendly Version</a>

where printable.htm is the name of your printer friendly page.

The only problem with this is that some aggressively set pop up blockers will block it. No way around that. Fortunately, most folks don't use the really aggressive settings.