Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    How to print an activeLink

    I have a <div> that contains two tags that reference to another <div>.

    <a onclick="Printelement('tester');" href"#">Print</a>

    <div class="test">
    <a id="play" class="again activeLink" href="javascript:;"> First </a>
    <a id="play1" class="again" href="javascript:;"> First </a>
    </div>

    <div id="tester">
    </div>

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,474
    Thanks
    6
    Thanked 980 Times in 953 Posts
    Your post is lacking almost everything that helps us to understand what you are trying to achieve.

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,950
    Thanks
    0
    Thanked 236 Times in 233 Posts
    Do you want to print just the content of tester div? If so, then you can use @media print css rule to hide the content you don't want to print and adjust some styles of the content you want to print.

  • #4
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I apologize, I didn't put in what I need.
    I have a <div> that contains two tags that reference to another <div>.

    <a onclick="Printelement('tester');" href"#">Print</a>

    <div class="test">
    <a id="play" class="again activeLink" href="javascript:;"> First </a>
    <a id="play1" class="again" href="javascript:;"> First </a>
    </div>

    <div id="tester">
    </div>

    What I need to happen is when the print button is clicked, it only prints whats showing on the page, not print everything in the page. So in this case, the first <a id="play"> is showing since its the activeLink. If the 2nd <a> tag was clicked and showing, it would print that element.

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,950
    Thanks
    0
    Thanked 236 Times in 233 Posts
    Then I was right. You need @media print css rule to do that. Follow the link I posted in my previous post.


  •  

    Posting Permissions

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