Results 1 to 7 of 7

Thread: Scrollable Windows within a Page

  1. #1
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default Scrollable Windows within a Page

    I would like to use scrollable windows on a page, like the ones found here: www.hnlnow.com. Actually, they are used on DD too, to display the code sections, and I tried doing it the way DD does with <form><textarea>, and it does do a scrollable window BUT what gets displayed in the textbox is all the raw code complete with html tags and php code. You can see the problem here:

    http://www.calendarmaui.com/index-scrollbox.php

    How do I get it to display the generated code rather than the literal code?

    Thanks! erin

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Two basic options. Really only one good one. You can use an iframe to display another page on your page. But iframe is non-standard in its implementation and is being phased out, it is the 'bad' option, but still workable in some cases. The good option is to use a div element with set width and height and overflow auto, ex:

    HTML Code:
    <div style="width:250px;height:175px;overflow:auto;">
    If your content in here is no wider than 250px or can wrap to 250px width, 
    when it's height exceeds 175px, a vertical scrollbar will appear to aid in 
    viewing the portion of the content not that's not at first visible.<br>&nbsp;<br>
    If your content in here is no wider than 250px or can wrap to 250px width, 
    when it's height exceeds 175px, a vertical scrollbar will appear to aid in 
    viewing the portion of the content not that's not at first visible.
    </div>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    kuau (05-18-2008)

  4. #3
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Default

    Try changing the textarea to a div:
    Code:
          <div class="scrollbox" name="S1">
          ...
          </div>
    and your css code to
    Code:
    .scrollbox { width:371px; height:310px; margin:0; padding:0; overflow: scroll;}
    -Ben -- THE DYNAMIC DRIVERS
    My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
    I told my client to press F5, the client pressed F, then 5, *facepalm*

  5. The Following User Says Thank You to fileserverdirect For This Useful Post:

    kuau (05-18-2008)

  6. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by fileserverdirect View Post
    Try changing the textarea to a div:
    Code:
          <div class="scrollbox" name="S1">
          ...
          </div>
    and your css code to
    Code:
    .scrollbox { width:371px; height:310px; margin:0; padding:0; overflow: scroll;}
    You cannot have a name for a div in valid HTML, and using the scroll value for overflow will produce both vertical and horizontal scrollbars regardless of whether either is required to view the content. See my solution in my previous post in this thread for a workable and valid method.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. The Following User Says Thank You to jscheuer1 For This Useful Post:

    kuau (05-18-2008)

  8. #5
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    Dear John & FSD:

    That was brilliant! Thank you so much! Now it is exactly as I wanted it. I wish everything were that easy to fix. I could have spent all day trying to figure that out.

    Mahalo plenty! erin

  9. #6
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default Fumbling Through

    Dear John:

    Yeah, I immediately removed the name="S1" because that was leftover as part of the DD code for <textarea>. I tried both scroll and auto for the overflow and ended up leaving it as auto, so I accidentally did it correctly. Now I understand the difference. Thanks for explaining.

    Aloha, erin

  10. #7
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Default

    Sorry john, I did not relized you had posted. When I did the "Quick Reply" my post showed up beneath the original question. And thanks for correcting my mistake.
    -Ben -- THE DYNAMIC DRIVERS
    My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
    I told my client to press F5, the client pressed F, then 5, *facepalm*

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
  •