Results 1 to 9 of 9

Thread: [RESOLVED] Setting 'OVERFLOW' to '<not set>'

  1. #1

    Thread Starter
    Hyperactive Member JMvVliet's Avatar
    Join Date
    May 2001
    Location
    Papendrecht, Netherlands
    Posts
    310

    Resolved [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

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196

    Re: Setting 'OVERFLOW' to '<not set>'

    you might get better results with CSS print media type .

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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;

  4. #4

    Thread Starter
    Hyperactive Member JMvVliet's Avatar
    Join Date
    May 2001
    Location
    Papendrecht, Netherlands
    Posts
    310

    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.

  5. #5

    Thread Starter
    Hyperactive Member JMvVliet's Avatar
    Join Date
    May 2001
    Location
    Papendrecht, Netherlands
    Posts
    310

    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

  6. #6
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Setting 'OVERFLOW' to '<not set>'

    Quote 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?

  7. #7

    Thread Starter
    Hyperactive Member JMvVliet's Avatar
    Join Date
    May 2001
    Location
    Papendrecht, Netherlands
    Posts
    310

    Re: Setting 'OVERFLOW' to '<not set>'

    Oh, I'm sorry not to mention that: ASP.NET (VB.NET)...

  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Setting 'OVERFLOW' to '<not set>'

    Could it be...

    sb.Append("var mydiv = document.getElementById('pnlData');")

  9. #9

    Thread Starter
    Hyperactive Member JMvVliet's Avatar
    Join Date
    May 2001
    Location
    Papendrecht, Netherlands
    Posts
    310

    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
  •  



Click Here to Expand Forum to Full Width