Jump to content

2 textareas with one scroller


Recommended Posts

What would the script be for having 2 textareas with 1 scroller?

Hide other scrollbar? How? I have no idea how to do it.But scroll ta2 when ta1 scrolls and on contrary?I think textarea has no onscroll event? (with MSIE it has, but not within the real browsers).So we should try something else, like onmousedown or onmouseup.
<textarea id="ta1" onmousedown="document.getElementById('ta2').scrollTop = this.scrollTop">textarea1Litlle Goat says: IE is fine!where is the cat?cat is in the moon! :owho are you?</textarea><textarea id="ta2" onmousedown="document.getElementById('ta1').scrollTop = this.scrollTop">textarea2raimo says: Opera is finest!;)gerbils are my friendsme tarzan you jane?snow is gone</textarea>

if there is no need scroll ta1 when ta2 scrolls remove onmousedown-code of ta2Tested only with Firefox (linux version), and works somehow.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...