B
B
Boris22222018-03-16 15:47:00
JavaScript
Boris2222, 2018-03-16 15:47:00

How to implement a progress bar using js when scrolling a div element?

Suppose there is a page on which not the "body" element is scrolled, but a certain "div", how can I implement a horizontal progress bar when scrolling? I used different libraries, but they did not help because they calculated the scroll position through the "body".

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
riot26, 2018-03-16
@Boris2222

https://jsfiddle.net/riot26/4ocnk8n6/

A
ajlhimik, 2018-03-16
@ajlhimik

or do it yourself so life doesn't look like honey
.scrollTop()
Returns: Integer
Gets the left scroll padding value for the first element in the set.
.scrollTop(Value)
Returns: jQuery
Sets the left scroll padding value for all elements in the set.
axis from there taken https://ruseller.com/jquery.php?id=57
and css about the same :D : htmlbook.ru/blog/polzovatelskie-skrollbary-v-webkit

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question