Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Scrolling

Reply
Thread Tools

Scrolling

 
 
K.
Guest
Posts: n/a
 
      11-16-2006
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.

Would you like to help me how to do that?

Thank you in advance
M. from Poland


 
Reply With Quote
 
 
 
 
K.
Guest
Posts: n/a
 
      11-16-2006

Użytkownik "Andrew C" <(E-Mail Removed)> napisał w wiadomości
news:SGU6h.39505$(E-Mail Removed)...
>
> "K." <(E-Mail Removed)> wrote in message
> news:ejh3j4$nup$(E-Mail Removed)...
>> 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


 
Reply With Quote
 
 
 
 
K.
Guest
Posts: n/a
 
      11-16-2006

Użytkownik "Andrew C" <(E-Mail Removed)> napisał w wiadomości
newslW6h.32995$(E-Mail Removed)...
>
> "K." <(E-Mail Removed)> wrote in message
> news:ejh64e$u6f$(E-Mail Removed)...
>>
>> Użytkownik "Andrew C" <(E-Mail Removed)> napisał w wiadomości
>> news:SGU6h.39505$(E-Mail Removed)...
>>>
>>> "K." <(E-Mail Removed)> wrote in message
>>> news:ejh3j4$nup$(E-Mail Removed)...
>>>> 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

>
> Try:
>
> <textarea id="biografia" readonly="true" ...>
> ...
> </textarea>
>
> A.
>


Unfortunately this example doesn`t give me a solution I would like to have.
I would like to have textarea element with updating possibilites.

I tried

var elem=document.getElementById("biografia");

if(elem)
{
elem.focus();
MoveToEnd(elem);
elem.focus();
}

but also without results.
I use IE 6.0.

Please help me, I cannot find any properly-working solution in post
archieves
Thank you Andrew for helping
Marcin


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
smooth scrolling & auto scrolling sillyputty Firefox 1 08-24-2007 02:10 AM
Funny scrolling bug Alvaro G. Vicario Firefox 0 06-19-2004 12:44 PM
Firefox mouse scrolling button barasch@NOSPAM.hotmail.com Firefox 2 02-26-2004 06:38 PM
Mozilla Composer drag n' drop scrolling Jukka Hellen Firefox 2 11-26-2003 11:39 PM
Scrolling up and down Tono Firefox 0 08-23-2003 04:41 PM



Advertisments