Click to See Complete Forum and Search --> : Displaying text already "scrolled down" in a <div>


Jayhawk
04-07-2006, 07:13 PM
I have the following display:

<div class='black t10 lt' style='width:390px; height:235px; background:#f2f2f2; padding:10px; margin-left:10px; border:1px solid #000000; text-align:left; float:left; overflow:auto'>

text here with specified word highlited

</div>


The problem arises when the text is too long for the container and the highlighted word is in the portion of the text that is below the bottom edge -- the viewer needs to scroll down for the highlighted word to be visible. How can I cause the text to be displayed so that it is already scrolled down and the highlighted word is in the visible portion of the text?

Note that taking it to the end might not work, since that might be overkill and result in the highlighted word being above the visible portion of the text.

ray326
04-08-2006, 12:12 AM
What if you give the highlighted text an id and reference it in a fragment.
text here with <span id="special">specified</span> word highlighted
Then reference it with href="thespecialpage.html#special".

Just a WAG.

Jayhawk
04-08-2006, 10:33 AM
Thanks for the idea. Unfortunately, the page isn't the result of a call from a link. It is activated by a <form> which displays this page after processing the form data. The user is clicking on an <input> rather than a <href> to continue to the next highlighted word. I looked for a way to make it continue by means of an <href> but it needs to take form variables with it.

Edit: or, wait, can the "#word" go in the action part of the <form> tag? While I'm waiting for someone to answer that if they want to I'm going to go try it out.

Edit #2: nope, it doesn't fly. Still need help.

Jayhawk
04-09-2006, 09:36 AM
Okay, forget the highlighted word. Is there a way to position the scrollbar at all?

ray326
04-09-2006, 11:33 PM
Edit: or, wait, can the "#word" go in the action part of the <form> tag? While I'm waiting for someone to answer that if they want to I'm going to go try it out.It would go on the form handler's response, which would normally be a redirect to the associated response page.