title: jQuery algorithm scrolling speed
body: <p>There are dwo divs <strong>#leftPane</strong> and <strong>#rightPane</strong>. #leftPane has position relative and browser set scrollbar acording to its height, meanwhile #rightPane has position: fixed and I add top: -value to it while scrolling, so we 'scroll' secont div with different speed. What I want to achieve is get something like scrollSpeedModifier according to 1. browser window height, 2 leftPane content height and 3 rightPane content height (2,3 content height might be different each time).</p>
  
  <p>So while scrolling #leftPane - if content of #rightPane is bigger than #leftPane its top value grow faster than normal scrolling, but when #rightPane content height is smaller than #leftPanes top value grow slower than normal scroling.</p>
  
  <p>This is the way I count the speed right now:</p>
  
  <pre><code>ar scrollSpeed = (rightPaneHeight) / browserHeight;
  </code></pre>
  
  <p>but it's wrong, sometimes we get to the middle of the #rightPane and when we change the 'browser' size (jfiddle window size) we might get till the end of #rightPane.</p>
  
  <p>This is the code I end up so far:</p>
  
  <p><a href="http://jsfiddle.net/bVfcX/15/" rel="nofollow">http://jsfiddle.net/bVfcX/15/</a></p>