Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
153
rated 0 times [  154] [ 1]  / answers: 1 / hits: 33249  / 13 Years ago, wed, january 11, 2012, 12:00:00

I have a website where users click a read more button so that they can view the rest of the information on the page. I am curious how I could make it so that users do not have to print each page seperately. I would like to be able to make it so that I could have a script that print's related pages. I'f anyone could help me out and point me in the right direction it would be greatly appreciated. I need this functionality to work in all browsers.



Thanks


More From » javascript

 Answers
17

What you will need to pull this off is a stylesheet that utilizes media styles. It is basically like having two seperate stylesheets; one for printing and one for viewing. In order to be bandwidth conservative leave the printarea empty until the request is made. On the request event fill in the printarea with the whole print you with to do. I would suggest you look into jQuery and their load and ajax requests for this.



@media screen
{
#screenarea
{
display: block;
}
#printarea
{
display: none;
}
}
@media print
{
#screenarea
{
display: none;
}
#printarea
{
display: block;
}
}

[#88077] Tuesday, January 10, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
zariahdiamondz

Total Points: 649
Total Questions: 109
Total Answers: 88

Location: Tajikistan
Member since Thu, Apr 14, 2022
2 Years ago
;