overlayscrollbars
Advanced tools
Comparing version 2.0.1 to 2.0.2
/*! | ||
* OverlayScrollbars | ||
* Version: 2.0.1 | ||
* Version: 2.0.2 | ||
* | ||
@@ -5,0 +5,0 @@ * Copyright (c) Rene Haas | KingSora. |
/*! | ||
* OverlayScrollbars | ||
* Version: 2.0.1 | ||
* Version: 2.0.2 | ||
* | ||
@@ -5,0 +5,0 @@ * Copyright (c) Rene Haas | KingSora. |
@@ -7,2 +7,8 @@ # Changelog | ||
- The `viewport` and `padding` elements won't have the style `position: relative` anymore if its not needed. The style is only needed for older browsers. ([#489](https://github.com/KingSora/OverlayScrollbars/issues/489)) | ||
## 2.0.1 | ||
### Bug Fixes | ||
- The custom scrollbars are now always hidden if the `showNativeOverlaidScrollbars` option is `true`. | ||
@@ -9,0 +15,0 @@ |
{ | ||
"name": "overlayscrollbars", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "A scrollbar plugin that hides native scrollbars, provides custom styleable overlay scrollbars and keeps the native functionality and feeling.", | ||
@@ -5,0 +5,0 @@ "author": "Rene Haas | KingSora", |
@@ -71,3 +71,3 @@ <div align="center"> | ||
<summary> | ||
These instructions are for old stacks. Click here to read them. | ||
These instructions are for quick prototyping or old stacks. Click here to read them. | ||
</summary> | ||
@@ -86,4 +86,10 @@ <br /> | ||
<link type="text/css" href="path/to/overlayscrollbars.css" rel="stylesheet" /> | ||
<script type="text/javascript" src="path/to/overlayscrollbars.js" defer></script> | ||
<script type="text/javascript" src="path/to/overlayscrollbars.browser.js" defer></script> | ||
``` | ||
You can use the global variable `OverlayScrollbarsGlobal` to access the api: | ||
```js | ||
var OverlayScrollbars = OverlayScrollbarsGlobal.OverlayScrollbars; | ||
OverlayScrollbars(document.body, {}); | ||
``` | ||
</details> | ||
@@ -486,2 +492,47 @@ | ||
## FAQ | ||
<details> | ||
<summary> | ||
How do I <code>get / set</code> the <code>scroll position</code> of an element I applied the OverlayScrollbars to? | ||
</summary> | ||
<br /> | ||
If you applied `OverlayScrollbars` to the `body` element you can use [`window.scrollX`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX), [`window.scrollY`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY), [`window.scroll`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll), [`window.scrollTo`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo), [`window.scrollBy`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy) or any other native api. | ||
If the plugin was applied to any other element you have to get the `viewport` element with the `instance.elements()` function first. With this element you can use [`element.scrollTop`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop), [`element.scrollLeft`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft), [`element.scroll`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scroll), [`element.scrollTo`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo), [`element.scrollBy`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollBy) or any other native api. | ||
```js | ||
const { viewport } = osInstance.elements(); | ||
const { scrollLeft, scrollTop } = viewport; // get scroll offset | ||
viewport.scrollTo({ top: 0 }); // set scroll offset | ||
``` | ||
</details> | ||
<details> | ||
<summary> | ||
Is it possible to <code>limit / adjust the scrollbar handle length</code>? | ||
</summary> | ||
<br /> | ||
You can adjust a scrollbars handle length by setting a `min-width / min-height` and `max-width / max-height` style: | ||
```css | ||
/* horizontal boundaries */ | ||
.os-scrollbar-horizontal .os-scrollbar-handle { | ||
min-width: 50px; | ||
max-width: 200px; | ||
} | ||
/* vertical boundaries */ | ||
.os-scrollbar-vertical .os-scrollbar-handle { | ||
min-height: 40px; | ||
max-height: 40px; | ||
} | ||
``` | ||
You can assign the same value to both properties to force the scrollbar to be always the same size. | ||
Setting the `width` and `height` properties won't work since those are set by the plugin automatically. | ||
</details> | ||
## Feature comparison to `v1` | ||
@@ -488,0 +539,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4233557
17620
565