I have a horizontal progress bar that expands or contracts based on the scroll position. horizontal progress bar width = vertical document scroll position.
<div class="progress-bar" style="width:50%;"></div>
With this I have a bookmark function that appends a caret (element) to the progress bar (element). It is absolutely positioned relative to the progress bar width. There can be multiple bookmarks.
<div class="progress-bar" style="width:50%;">
<div class="caret" style="left:50%;"></div>
<div class="caret" style="left:60%;"></div>
</div>
What I would like to do is construct a scrollto function when I click on each caret using the left position as the scrollto variable.
See https://jsfiddle.net/jabuka/spevhqxv/
Thank you.