Web Hosting Talk







View Full Version : jquery simultaneous scrolling


Syphic
01-05-2009, 11:36 PM
I have a 2 textareas right beside each other and wanted to know how can I make it so when i scroll one the other one scrolls?
This needs to work no matter if both textareas are the same size or not. It is for comparing code.

Syphic
01-06-2009, 01:20 AM
Figured it out
everything you scroll textarea file_content it will take cnum to the same place
$(document).ready(function(){
$('#file_content').scroll(function(){
$('#cnum').animate({scrollTop: $('#file_content').scrollTop()});
});
});