doc: fix calculation, padding should be ok now.

This commit is contained in:
Mathieu Virbel 2013-04-30 18:40:50 +02:00
parent 1052283a51
commit 19fd327679
1 changed files with 2 additions and 2 deletions

View File

@ -200,13 +200,13 @@ $(document).ready(function () {
function update_api() {
var ywindow = jwindow.scrollTop();
var ypadding = 20;
var ydiff = ywindow - initial_offset.top + ypadding;
var ydiff = ywindow - initial_offset.top;
var height = jwindow.height();
if ( ydiff + ypadding > 0) {
divscroll.css('position', 'fixed').css('top', ypadding);
height -= ypadding * 2;
} else {
divscroll.css('position', 'fixed').css('top', -ydiff);
divscroll.css('position', 'static').css('top', -ydiff);
height += ydiff - ypadding;
}
divscroll.height(height).width(divscrollwidth);