View Full Version : 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 :)
jscheuer1
05-18-2008, 01:59 AM
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:
<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> <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>
fileserverdirect
05-18-2008, 02:10 AM
Try changing the textarea to a div:
<div class="scrollbox" name="S1">
...
</div>
and your css code to
.scrollbox { width:371px; height:310px; margin:0; padding:0; overflow: scroll;}
:)
jscheuer1
05-18-2008, 02:23 AM
Try changing the textarea to a div:
<div class="scrollbox" name="S1">
...
</div>
and your css code to
.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.
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 :)
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 :)
fileserverdirect
05-18-2008, 02:49 AM
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.
:)
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.