noeldelgado / gemini-scrollbar

:first_quarter_moon: Custom overlay-scrollbars with native scrolling mechanism for web applications
https://noeldelgado.github.io/gemini-scrollbar/
MIT License
428 stars 63 forks source link

add - drag thumb from anywhere on the track #44

Open amaau opened 7 years ago

amaau commented 7 years ago
function _clickVerticalTrackHandler(e) {
    var offset = e.offsetY - this._naturalThumbSizeY * .5,
        thumbPositionPercentage = offset * 100 / this._scrollbarVerticalElement.clientHeight;

    this._viewElement.scrollTop = thumbPositionPercentage * this._viewElement.scrollHeight / 100;

    > this._prevPageY = this._thumbSizeY - e.offsetY + offset; 
    > this._startDrag(e)
}
koodikulma-fi commented 6 years ago

Also was just gonna suggest this. Tho, with this line instead (in addition to this._startDrag(e)): this._prevPageY = this._naturalThumbSizeY * .5;