SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot egiblock's Avatar
    Join Date
    Aug 2001
    Location
    Mentor, Ohio
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Control Printing (What Prints) with Javascript ?

    Quick Question..

    When designing a site, a request has come to me about printing web pages. What they want is the page to be broken up into frames, and only one frame will be able to be printed. so that if the page is broken into 3 vertical frames. Would it be possible to have it only print the middle page if the person clicked the print button.

    This is so that even beginner users to IE or Netscrape would be able to get a printout of the page without having to change options in the print preferences.


    * The example the person gave me was similar to Page Breaks in MS Excel. You can see the whole thing, but when print is clicked, you only get a certain section printing (even a beginner can do this).

    Thanks.

  2. #2
    SitePoint Wizard silver trophy KLB's Avatar
    Join Date
    Nov 2003
    Location
    Maine USA
    Posts
    3,781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A better way would be to eliminate the frames and then us CSS to turn off parts of a webpage and reformat it when it is printed. This would require no JavaScript. To define a different look when printing use the following and create the proper stylesheet:

    Code:
    	<style type="text/css" media="print">
    		@import url('/stylesheets/printer.css') print;
    	</style>
    Ken Barbalace: EnvironmentalChemistry.com (Blog, Careers)
    InternetSAR.org
    Volunteers Assist Search and Rescue via Internet
    My Firefox Theme: Classic Compact
    Based onFirefox's default theme but uses much less window space

  3. #3
    SitePoint Zealot egiblock's Avatar
    Join Date
    Aug 2001
    Location
    Mentor, Ohio
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any chance you would have a site off the top of your head that does this ??? so i can show them that it can be done.

    also, any links on printer formatting sites using the css sheats. i can format pages just fine, just didn't know you could format the pages for printing that way too..

  4. #4
    SitePoint Wizard silver trophy KLB's Avatar
    Join Date
    Nov 2003
    Location
    Maine USA
    Posts
    3,781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The following sites turns off their menus when printing:
    http://meccounter.com
    http://www.wecenv.com/
    Ken Barbalace: EnvironmentalChemistry.com (Blog, Careers)
    InternetSAR.org
    Volunteers Assist Search and Rescue via Internet
    My Firefox Theme: Classic Compact
    Based onFirefox's default theme but uses much less window space


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
  •