function scroll(self) {
    var $elements = $('textarea#editor, article#previewValue');
    var $other = $elements.not(self).off('scroll'), other = $other.get(0);
    var percentage = self.scrollTop / (self.scrollHeight - self.offsetHeight);
    other.scrollTop = percentage * (other.scrollHeight - other.offsetHeight);
    setTimeout(function () {
        $elements.scroll(sync);
    }, 100);
}
/**
 * Set other panel scroll to same value.
 * @param self which panel was scroll
 */
Set other panel scroll to same value.
@param self which panel was scroll
Set other panel scroll to same value . @param self which panel was scroll
function scroll(self) {
    var $elements = $('textarea#editor, article#previewValue');
    var $other = $elements.not(self).off('scroll'), other = $other.get(0);
    var percentage = self.scrollTop / (self.scrollHeight - self.offsetHeight);
    other.scrollTop = percentage * (other.scrollHeight - other.offsetHeight);
    setTimeout(function () {
        $elements.scroll(sync);
    }, 100);
}
function scroll ( self ) { var $elements = $ ( 'textarea#editor, article#previewValue' ) ; var $other = $elements . not ( self ) . off ( 'scroll' ) , other = $other . get ( 0 ) ; var percentage = self . scrollTop / ( self . scrollHeight - self . offsetHeight ) ; other . scrollTop = percentage * ( other . scrollHeight - other . offsetHeight ) ; setTimeout ( function ( ) { $elements . scroll ( sync ) ; } , 100 ) ; }
Set other panel scroll to same value.
Set other panel scroll to same value .