Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > print a page with scrolling <div>

Reply
Thread Tools

print a page with scrolling <div>

 
 
Martin Nadoll
Guest
Posts: n/a
 
      11-12-2005
Hello,

i have a page with a div-Tag, positioned absolute, overflow:auto that shows
a scrollbar, because content is to big.

Now i have a button on that page called "print page".
That is only a <a href"javascript:window.print()"> command.

My problem:
It prints only the on screen shown part of my content, not the whole
content, which is, what i want to print.

Is there any workaround for that problem?
Maybe something with css-media?

Thanks for any help,
Martin Nadoll


 
Reply With Quote
 
 
 
 
Spartanicus
Guest
Posts: n/a
 
      11-12-2005
"Martin Nadoll" <> wrote:

>i have a page with a div-Tag, positioned absolute, overflow:auto that shows
>a scrollbar, because content is to big.


Get rid of it, "scrolling divs" are a usability nightmare. Scrolling
with the wheel of a mouse is poorly supported, keyboard users cannot
scroll it at all.

Place a small bit of the content on the page followed by a "... More"
link that links to the full text.

>Now i have a button on that page called "print page".
>That is only a <a href"javascript:window.print()"> command.


Replicating a function found on all browsers serves no purpose, using
javascript is even more silly since a significant number of clients will
have javascript disabled.

--
Spartanicus
 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?Dav=E9mon?=
Guest
Posts: n/a
 
      11-12-2005
Martin Nadoll wrote:
> Hello,
>
> i have a page with a div-Tag, positioned absolute, overflow:auto that shows
> a scrollbar, because content is to big.
>
>
> My problem:
> It prints only the on screen shown part of my content, not the whole
> content, which is, what i want to print.
>
> Is there any workaround for that problem?
> Maybe something with css-media?
>


Something like:

<link rel="stylesheet" href="print.css" type="text/css" media="print">

in your html, and:

#whatever_id_your_div_is
{overflow:none;}

in the print.css

should solve that.

--

Davémon
http://www.nightsoil.co.uk
 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      11-12-2005
With neither quill nor qualm, =?ISO-8859-1?Q?Dav=E9mon?= quothed:

> Martin Nadoll wrote:
> > Hello,
> >
> > i have a page with a div-Tag, positioned absolute, overflow:auto that shows
> > a scrollbar, because content is to big.
> >
> >
> > My problem:
> > It prints only the on screen shown part of my content, not the whole
> > content, which is, what i want to print.
> >
> > Is there any workaround for that problem?
> > Maybe something with css-media?
> >

>
> Something like:
>
> <link rel="stylesheet" href="print.css" type="text/css" media="print">
>
> in your html, and:
>
> #whatever_id_your_div_is
> {overflow:none;}
>
> in the print.css
>
> should solve that.


Perhaps "overflow:visible;" would be better.

--
Neredbojias
Contrary to popular belief, it is believable.
 
Reply With Quote
 
=?ISO-8859-1?Q?Dav=E9mon?=
Guest
Posts: n/a
 
      11-13-2005
Neredbojias wrote:
> With neither quill nor qualm, =?ISO-8859-1?Q?Dav=E9mon?= quothed:
>
>
>>Martin Nadoll wrote:
>>
>>>Hello,
>>>
>>>i have a page with a div-Tag, positioned absolute, overflow:auto that shows
>>>a scrollbar, because content is to big.
>>>
>>>
>>>My problem:
>>>It prints only the on screen shown part of my content, not the whole
>>>content, which is, what i want to print.
>>>
>>>Is there any workaround for that problem?
>>>Maybe something with css-media?
>>>

>>
>>Something like:
>>
>><link rel="stylesheet" href="print.css" type="text/css" media="print">
>>
>>in your html, and:
>>
>>#whatever_id_your_div_is
>> {overflow:none;}
>>
>>in the print.css
>>
>>should solve that.

>
>
> Perhaps "overflow:visible;" would be better.
>


My apologies. Yes "overflow:visible;" is correct.

Also set "height:auto;" if you're not declaring the screen css
explicitly as such (i.e. the #whatever_id_your_div_is is inheriting a
height value from another definition), otherwise it will overlap any
content below, instead of forcing it down.




--

Davémon
http://www.nightsoil.co.uk
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
print a vs print '%s' % a vs print '%f' a David Cournapeau Python 0 12-30-2008 03:19 AM
smooth scrolling & auto scrolling sillyputty Firefox 1 08-24-2007 02:10 AM
Problem - I want to print Current Output of Pdf file and should print once.I get print dialog box but it is not working keto Java 0 05-30-2007 11:27 AM
How to print a scrolling region in a JSP? Adam Lipscombe Java 1 01-22-2006 03:08 AM
Unlarging the print to print using PDF file to print Bun Mui Computer Support 3 09-13-2004 03:15 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57