Forum Moderators: open
All scripts I found are extremely complicated. They scroll the content up and down, but I do not really want to scroll
Thanks in advance,
Andrei
Have you tried not declaring any height for the div? That way the div should automatically expand to display all the content with no overflow scrolling.
Of course if it's more than a screenful, there will be page scrolling, but there won't be any little "internal" scrollbars just for the div.
DIV.borderedPanel {margin:0; height:100%; width:100%; overflow:scroll; background-color: <%= backgr.getMainColor() %>; border-style:solid; border-width:2px; border-color: black #E9E9E9 #E9E9E9 black; padding:3}
DIV.leftWrapper {margin:0; padding:3px 2px 3px 4px; height:100%; width:auto; background: transparent; border:none}
<body>
<div class="leftWrapper">
<div class="borderedPanel">
some content
</div>
</div>
</body>
maybe it is better to use iframe instead?
But I guess I'm missing something. If the div fills the browser area completely, why not just allow the standard browser scrollbar to appear if someone's display requires it?
That is, why introduce the complication of a possible second scrollbar on the screen if the div already goes from top to bottom?
You need the div to be scrolled to the very bottom of the chat content, so that the most recent messages are always on screen. And the div should also fill the screen top to bottom (but not right to left) so that a maximum amount of chat is visible.
With an iframe you have the use of javascript methods - scrollBy() and scrollTo(), but I can't immediately see how to get the scroll to the bottom of the chat. There was an HTMLElement.scrollIntoView() but that was IE only, I believe.
Looks like we still don't have all the answers you need. Anyone?
I suggest using an <iframe>, specifying it's width:100% height: 100%, within your content <div> set to width whatever and height:100% ...as Opera does not support the overflow: scroll there is no real advantage to trying to make the div scroll
Then if you make your content page and put:
<META HTTP-EQUIV="Refresh" CONTENT="10; URL=yourchatpage.htm#bottom">
within the head tags of this document and:
<a name="bottom"></a>
below your chat section,
in your calling (main) page have <iframe src="yourchatpage.htm#bottom"> within the content <div>
this works in IE6 and netscape, and still might be a solution for you as it still produces the scrollbars in Opera which will alow users to scroll anyway...and keeps your page to the required height
Suzy