|
-
Jan 23rd, 2007, 09:07 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Setting 'OVERFLOW' to '<not set>'
Hi all,
I have a DIV panel in an ASPX page. At default it loads with scrollbars (OVERFLOW: auto). If I want the page to print (by clicking a button), I want to delete the OVERFLOW tag, send window.print() and after printing, set the OVERFLOW tag to auto again.
My question: is this possible to do with JavaScript? If Yes, How can I achieve this goal?
Thanx in advance,
JMvV
-
Jan 23rd, 2007, 10:35 AM
#2
Re: Setting 'OVERFLOW' to '<not set>'
you might get better results with CSS print media type .
-
Jan 23rd, 2007, 10:47 AM
#3
Re: Setting 'OVERFLOW' to '<not set>'
I agree that you should use a specific print stylesheet. But, for the sake of it, here's how you do it using Javascript:
Code:
var mydiv = document.getElementById('something');
mydiv.style.overflow = null;
-
Jan 23rd, 2007, 03:28 PM
#4
Thread Starter
Hyperactive Member
Re: Setting 'OVERFLOW' to '<not set>'
sure that works? I can't get it to work. Have done this:
Code:
sb.Append("var mydiv = document.getElementById('pnlData');"
sb.Append("mydiv.style.overflow = hidden;")
btnPrint.Attributes.Add("onclick", sb.ToString())
btnPrint is an ImageButton...
it gives me an error, and it posts back... and I don't know what I'm doing wrong.
-
Jan 23rd, 2007, 03:46 PM
#5
Thread Starter
Hyperactive Member
Re: Setting 'OVERFLOW' to '<not set>'
by the way: read this about css:
(Authored by Kevin Venkiteswaran) Part of browsers' poor support for printing includes butchering content that is laid out with anything but position: static. This includes "simple" positioning such as relative and absolute. For example, Win/IE5.0 and Win/IE5.5 would show only the top-most onscreen portion of a <div> that was positioned absolute and had overflow: auto (a CSS setup to emulate HTML frames). Similarly, Mozilla 1.6 had similar problems. The solution was to change all position properties from fixed, absolute, etc. back to static
-
Jan 24th, 2007, 12:52 AM
#6
Re: Setting 'OVERFLOW' to '<not set>'
 Originally Posted by JMvVliet
sure that works? I can't get it to work. Have done this:
Code:
sb.Append("var mydiv = document.getElementById('pnlData');"
sb.Append("mydiv.style.overflow = hidden;")
btnPrint.Attributes.Add("onclick", sb.ToString())
btnPrint is an ImageButton...
it gives me an error, and it posts back... and I don't know what I'm doing wrong.
What language is that in?
-
Jan 24th, 2007, 02:41 AM
#7
Thread Starter
Hyperactive Member
Re: Setting 'OVERFLOW' to '<not set>'
Oh, I'm sorry not to mention that: ASP.NET (VB.NET)...
-
Jan 26th, 2007, 07:21 AM
#8
Re: Setting 'OVERFLOW' to '<not set>'
Could it be...
sb.Append("var mydiv = document.getElementById('pnlData');")
-
Jan 26th, 2007, 07:24 AM
#9
Thread Starter
Hyperactive Member
Re: Setting 'OVERFLOW' to '<not set>'
Yeah, you're right, made a mistake in typing and copying the code... I've done it the right way .
Solved it another way, so I set this post to solved.
Thnx for all the replies.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|