Scrolling fixes

This commit is contained in:
magnolia-fan
2011-06-28 03:25:27 +04:00
parent 18b2b910ae
commit 391288d861
3 changed files with 63 additions and 42 deletions
+6 -1
View File
@@ -188,6 +188,7 @@
this.handleArrows = this.container.find('.scrollbar-handle-up, .scrollbar-handle-down');
this.handleArrowUp = this.container.find('.scrollbar-handle-up');
this.handleArrowDown = this.container.find('.scrollbar-handle-down');
this.pane_last_top = 0;
// set some default CSS attributes (may be overwritten by CSS definitions in an external CSS file)
this.pane.defaultCss({
@@ -388,7 +389,11 @@
// derive position of content from position of handle
this.pane.top = -1 * this.props.handleContentRatio * this.handle.top;
// var distance = Math.round(Math.abs(this.pane_last_top - this.pane.top));
// $(this.pane[0]).stop().animate({top: this.pane.top}, 10 * distance / Math.sqrt(distance));
this.pane[0].style.top = this.pane.top + 'px';
this.pane_last_top = this.pane.top;
},
@@ -398,7 +403,7 @@
onMouseWheel: function(ev, delta){
// calculate new handle position
this.handle.top -= delta*5; // awfull fix
this.handle.top -= delta*15; // awfull fix
this.setHandlePosition();
this.setContentPosition();