Użytkownik "Andrew C" <nonsense@totally.made.upnapisał w wiadomości
news:SGU6h.39505$Ib.20263@newsfe1-gui.ntli.net...
Quote:
>
"K." <halinacierniak@poczta.onet.plwrote in message
news:ejh3j4$nup$1@news.onet.pl... Quote:
>Hi!
>>
>I have such code:
>>
><textarea name="text_field">very long text</textarea>
>>
>I have filled in the value of textarea field. This value is a very long
>string.
>I would like to scroll this textarea field into the end.
| >
<script ...>
var longStringElement = getElementById("longString");
...
>
// Whenever you want the textarea to be scrolled to the bottom, do this:
longStringElement.scrollTop = longStringElement.scrollHeight;
</script>
...
<textarea id="longString"...... </textarea>
>
A.
>
>
|
Hi again!
Unfortunately this example doesn`t work on IE.
I have created such code:
<script language=JavaScript>
var biografiaElement = document.getElementById("biografia");
var utworyElement = document.getElementById("utwory");
alert(biografiaElement.scrollHeight);
biografiaElement.scrollTop = biografiaElement.scrollHeight;
utworyElement.scrollTop = utworyElement.scrollHeight;
</script>
Alert gives me 0 height and I don`t know why...
Please help me.
Thank you in advance
Marcin