You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-5Lines changed: 35 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -218,10 +218,10 @@ require.config({
218
218
and load `perfectScrollbar` in the initialiser of your app:
219
219
220
220
```javascript
221
-
#for vanilla JS:
221
+
// for vanilla JS:
222
222
window.Ps=require('perfectScrollbar');
223
223
224
-
#for jQuery:
224
+
// for jQuery:
225
225
require('perfectScrollbarJQuery');
226
226
```
227
227
@@ -250,12 +250,12 @@ function (angular) {
250
250
And initialise perfectScrollbar in a controller:
251
251
252
252
```javascript
253
-
# by vanilla JS:
253
+
// by vanilla JS:
254
254
var container =document.getElementById('imgLoader');
255
255
Ps.initialize(container);
256
256
Ps.update(container);
257
257
258
-
# or by jQuery:
258
+
// or by jQuery:
259
259
var imgLoader =$("#imgLoader")
260
260
imgLoader.perfectScrollbar();
261
261
```
@@ -316,6 +316,36 @@ When set to false, when clicking on a rail, the click event will be allowed to p
316
316
When set to true, you can scroll the container by selecting text and move the cursor.
317
317
**Default: false**
318
318
319
+
### theme
320
+
A string. It's a class name added to the container element. The class name is prepended with `ps-theme-`. So default theme class name is `ps-theme-default`. In order to create custom themes with scss use `ps-container($theme)` mixin, where `$theme` is a scss map.
321
+
**Default: 'default'**
322
+
323
+
**Example 1:**
324
+
325
+
Add `theme` parameter:
326
+
```javascript
327
+
Ps.initialize(container, {
328
+
theme:'my-theme-name'
329
+
});
330
+
```
331
+
Create a class name prefixed with `.ps-theme-`. Include `ps-container()` mixin. It's recommended to use `map-merge()` to extend `$ps-theme-default` map with your custom styles.
Alternatively, if you don't want to create your own themes, but only modify the default one, you could simply overwrite `$ps-*` variables with your own values. In this case `theme` parameter is not required when calling `.initialize()` method. Remember do define your own variables before the `theme.scss` file is imported.
347
+
348
+
319
349
## Events
320
350
321
351
perfect-scrollbar dispatches custom events.
@@ -396,7 +426,7 @@ For common problems there is a
396
426
397
427
## License
398
428
399
-
The MIT License (MIT) Copyright (c) 2015 Hyunje Alex Jun and other contributors.
429
+
The MIT License (MIT) Copyright (c) 2016 Hyunje Alex Jun and other contributors.
400
430
401
431
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
browsers: ['> 0%'],// '> 0%' forces autoprefixer to use all the possible prefixes. See https://github.com/ai/browserslist#queries for more details. IMO 'last 3 versions' would be good enough.
43
+
cascade: false
44
+
};
45
+
40
46
gulp.task('js',['clean:js'],function(){
41
47
vartasks=jsEntries.map(function(src){
42
48
returnbrowserify([src]).bundle()
@@ -87,6 +93,7 @@ gulp.task('clean:css:min', function () {
87
93
gulp.task('css',['clean:css'],function(){
88
94
returngulp.src('./src/css/main.scss')
89
95
.pipe(sass())
96
+
.pipe(autoprefixer(autoPrefixerConfig))
90
97
.pipe(insert.prepend(version))
91
98
.pipe(rename('perfect-scrollbar.css'))
92
99
.pipe(gulp.dest('./dist/css'))
@@ -96,6 +103,7 @@ gulp.task('css', ['clean:css'], function () {
0 commit comments