Open deanbot opened 9 years ago
I think this can be done by extending tinyscrollbar using the current methods. Not sure about how I feel about implementing this by default.
Hmm. To implement I converted # signs to query strings - grabbing the value and navigating using the following method on page load. Linking to areas on the same page was accomplished by adding a special class to links and locations - navigating on click. I could not get # signs to work.
Linking to an area on the same page required using position() where handling the location on page load required offset.
navigateToScrollLocation = function(loc, usePosition) {
if(!loc)
return;
// if clicking within the content use position instead of offset
var l = $('.sloc-'+loc),
lo = l ? (usePosition ? l.position() : l.offset() ) : false,
lp = lo ? lo.top : false,
lf = usePosition ? lp + 20 : lp - 150;
if(lo)
_this.scrollbarOptions.update(lf);
};
Noticing the following issues with named anchors (i.e. #terminology) within scrollbox content: