Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    Mar 2011
    Location
    Nashville, TN
    Posts
    340
    Member #
    27244
    Liked
    26 times
    I am looking into javascript print for being able to print a web page content i am designing. However, i cannot find the details on how to limit what prints and how to resize everything for someone when it prints. Such as, i dont want all my ads printing when they hit a print icon.


  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    You need to create a print.CSS file, google it to show how to call it.

    The easiest way I have found to make it work is to take your current CSS file, on all the elements you don't want to print, set an attribute of visibility: hidden; , then you can start formatting everything that's left to fit the page as you want.

    Don't make the mistake of just defining what you want to print, by default, if you don't define it, it will show and print.

  4. #3
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    As for the JavaScript part: JavaScript:window.print() on the onload event. But it can be tied to pretty much any event handler.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:28 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com