noeldelgado / gemini-scrollbar

:first_quarter_moon: Custom overlay-scrollbars with native scrolling mechanism for web applications

Home Page:https://noeldelgado.github.io/gemini-scrollbar/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add - drag thumb from anywhere on the track

amaau opened this issue · comments

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)
}

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