Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    May 2004
    Thanked 0 Times in 0 Posts

    print alternate page

    Hello all,
    I can print an alternate page if I include this line...
    <link rel="alternate" media="print" href="www.yahoo.com">
    but how can I include several different alternate print pages and print one of them with an onclick event link. How can I go about doing that??

  2. #2
    New Coder
    Join Date
    Sep 2002
    Thanked 0 Times in 0 Posts
    You could have different CSS files and change them dynamically. I do something similar to allow folks to change the font size. Then when the click the link it swaps the CSS.

    Here's the function I use:

    // Change CSS file.
    // cssId: ID of <link> to CSS file.
    // cssFile: Name of CSS file.
    // Example: changeCSS("cssBody", "body1.css");
    function changeCSS(cssId, cssFile){
    cssCurr = document.getElementById(cssId).href;
    path = cssCurr.substring(0, cssCurr.lastIndexOf("/"));
    cssFull = path+"/"+cssFile;

    Then I define my CSS link with the ID I want to swap out. For example:

    <link id="cssBody" href="/include/cssbody1.css" rel="stylesheet" type="text/css" media="all">


Posting Permissions

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