Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit 87b870f

Browse files
HarmenHarmen
Harmen
authored and
Harmen
committed
Working on documentation, colorization and scroll detection
1 parent 7be6395 commit 87b870f

15 files changed

+210
-293
lines changed

README.md

+27-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
# Scrollert.js - a cross browser, OSX-like, light weight scrollbar
2-
[Scrollert.js](https://syslogicnl.github.io/scrollert/) is a jQuery plugin that implements **good-looking and uniform scrollbars** on all browsers, platforms and devices. It has a small memory and DOM footprint in the browser and is fully customizable through CSS. It creates both **horizontal** and **vertical** scrollbars.
2+
Scrollert is a jQuery plugin that implements good-looking and uniform scrollbars on all browsers, platforms and devices. It has a small memory and DOM footprint in the browser and is fully customizable through CSS. It creates both horizontal and vertical scrollbars.
33

44
Scrollert.js can be loaded as a [UMD module](https://github.com/umdjs/umd) with your Module loader of choice (SystemJS, RequireJS, Webpack etc) or by loading it globally with a `<script>` tag.
55

66
Scrollert.js is written in Typescript and LESS.
77

88
Checkout our [website](https://syslogicnl.github.io/scrollert/) and the [Github repository](https://github.com/SyslogicNL/scrollert)!
99

10+
# Table of contents
11+
- [Support and compatibility](#support-and-compatibility)
12+
- [Basic usage](#basic-usage)
13+
- [Advanced usage](#advanced-usage)
14+
- [Default styling](#default-styling)
15+
- [Custom styling](#custom-styling)
16+
- [Options](#options)
17+
- [Methods](#methods)
18+
- [What if my content or container resizes?](#what-if-my-content-or-container-resizes-)
19+
- [FAQ](#faq)
20+
1021
# Support and compatibility
1122
Scrollert.js is thoroughly field tested and is compatible with:
1223
- *Chrome* (Windows, OSX, Linux)
@@ -61,7 +72,7 @@ Specify to which axis or axes Scrollert.js must listen. Gives horizontal and/or
6172

6273
**Default:** `['x', 'y']`
6374

64-
### preventOuterScroll
75+
### preventOuterScroll (experimental)
6576
Prevents scrolling of parent elements while hovering a scrollert pane.
6677

6778
**Type:** boolean
@@ -79,7 +90,6 @@ The prefix which is prepended to all css-classes.
7990
### eventNamespace
8091
The namespace in which all events are added. There is not really a use case to override this, but it is still possible though.
8192

82-
8393
**Type:** string
8494

8595
**Default:** `scrollert`
@@ -106,19 +116,29 @@ To destroy a Scrollert.js instance and revert all changes back to how it was bef
106116
jQuery('.scrollert').scrollert('destroy');
107117
```
108118

109-
## Events
110-
Not implemented yet.
119+
## What if my content or container resizes?
120+
It could be the case that your inner content or outer container resizes, due to things such as new content, a toggled view state or a window resize. Both inner and outer events can affect the size of the scrollbar. To detect changes in the content of a Scrollert-pane, you could use libraries such as:
121+
- https://github.com/sdecima/javascript-detect-element-resize
122+
- http://marcj.github.io/css-element-queries/
123+
124+
You could fire the update method on Scrollert.js to update the scrollbar according to the changed reality.
125+
```javascript
126+
addResizeListener($('#content-inner'), function() {
127+
jQuery('.scrollert').scrollert('update');
128+
});
129+
```
130+
111131

112132
# FAQ
113133
<sup>frequently asked and less frequently asked, but still answered:</sup>
114134
## How do I customize Scrollert.js?
115135
You can customize the looks of Scrollert.js by styling it using CSS.
116136

117137
## Why must I specify a tabindex on the content element?
118-
Good question. I forgot while developing. There really is a reason for that. When it comes to mind, I will update this question
138+
Specifying a tabindex allows the end-user to use it's keyboard arrow keys to navigate while the pane is focussed.
119139

120140
## Why is this plugin created? There are already so many javascript scrollbar plugins
121-
Syslogic is the maker of Scienta. The majority of our customers uses Windows. There was only one problem. Although we like windows, we are not quite fond of the default Windows scrollbar, especially not when used in an inline panel. To provide our customers with a beautiful and uniform scrolling experience, we searched for a scrollbar solution. We couldn't find one that suited our needs. So we decided to build one ourselfs.
141+
Syslogic is the maker of Scienta. We want to give our customers the best scrolling experience. The majority of our customers uses Windows. There was only one problem. Although we like windows, we are not quite fond of the default Windows scrollbar, especially not when used in an inline panel. To provide our customers with a beautiful and uniform scrolling experience, we searched for a scrollbar solution. We couldn't find one that suited our needs. So we decided to build one ourselfs.
122142

123143
# Build it yourself
124144
You don't have to stick to the shipped build. Why not build it yourself? You can run `npm install` and `gulp build` to create a customized build.

build/docs/layouts/parts/features/both.jade

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
div(class=" mdl-card mdl-shadow--2dp")
22
div(class="mdl-card__title mdl-color--primary mdl-color-text--white mdl-card--expand" style="height: 400px; padding:0;" )
3-
div(class="scrollert" style="width: 100%; height: 100%")
3+
div(class="scrollert scrollert-white" style="width: 100%; height: 100%")
44
div(class='scrollert-content' tabindex='1')
55
div(style="width:200%; height: 100%;")
66
h2(style="width:50%; float:left; line-height: 400px;") Scrolling

build/docs/layouts/parts/features/horizontal.jade

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
div(class=" mdl-card mdl-shadow--2dp" style="margin-top: 18px; ")
22
div(class="mdl-card__title mdl-color--primary mdl-color-text--white mdl-card--expand" style="height: 200px; padding:0;" )
3-
div(class="scrollert" style="width: 100%; height: 100%")
3+
div(class="scrollert scrollert-white" style="width: 100%; height: 100%")
44
div(class='scrollert-content' tabindex='1')
55
div(style="width:200%")
66
h2(style="width:50%; float:left; height: 200px; line-height:200px;") Horizontal
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
div(class=" mdl-card mdl-shadow--2dp")
22
div(class="mdl-card__title mdl-color--primary mdl-color-text--white mdl-card--expand" style="height: 618px; padding:0;" )
3-
div(class="scrollert" style="width: 100%; height: 100%")
3+
div(class="scrollert scrollert-white" style="width: 100%; height: 100%")
44
div(class='scrollert-content' tabindex='1')
55
h2(style="line-height: 618px;") Vertical
66
h2(style="line-height: 618px;") Vertical

build/docs/layouts/parts/header.jade

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
div(class="mdl-card__title scrollert header")
1+
div(class="mdl-card__title scrollert scrollert-white header")
22
div(class="scrollert-content")
33
div(style="width: 200%;")
44
h1(style="font-size: 160px; font-weight: bold; color: #fff; letter-spacing: 0.01em; width: 50%; float: left; padding-left: 2rem; box-sizing: border-box; padding-top: .1em;")
@@ -17,8 +17,6 @@ div(class="mdl-card__actions mdl-card--border")
1717
| Features
1818
a(class="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect" href="#documentation")
1919
| Documentation
20-
a(class="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect" href="#demos")
21-
| Demos
2220
a(class="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect" href="https://github.com/SyslogicNL/scrollert")
2321
| View on Github
2422

0 commit comments

Comments
 (0)