Results 1 to 2 of 2

Thread: When you click a Link it opens a specific sized pop up

  1. #1
    Join Date
    Jul 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow When you click a Link it opens a specific sized pop up

    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Code:
    <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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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