How to get scrollbar position with Javascript?

You can use element.scrollTop and element.scrollLeft to get the vertical and horizontal offset, respectively, that has been scrolled. element can be document.body if you care about the whole page. You can compare it to element.offsetHeight and element.offsetWidth (again, element may be the body) if you need percentages.

Overflow-x not working

Once you’ve floated the elements, you’ve taken them out the document flow and it won’t be calculated in the parent’s width. You have to use a combination of display: inline-block on the items instead of float, and then use white-space: nowrap on the parent. Fiddle Note: I’m using font-size: 0 to make the items appear … Read more

How to disable scrolling temporarily?

The scroll event cannot be canceled. But you can do it by canceling these interaction events:Mouse & Touch scroll and Buttons associated with scrolling. [Working demo] UPDATE: fixed Chrome desktop and modern mobile browsers with passive listeners

Auto scrolling with CSS

1.) You can’t initiate DOM actions with CSS or pure HTML. You always need a manipulating language (like JavaScript) 2.) You can remove the buttons by overwriting the current CSS and adjust the visibility or display tag to render them away or (placeholding) invisible. In the end you really need JavaScript for this to trigger dynamic hiding and to … Read more