angular-smooth-scrollbar

smooth-scrollbar for angular projects.
Requirements
Angular 1.4+
Install
Via npm:
npm install angular-smooth-scrollbar --save
Or via bower:
bower install angular-smooth-scrollbar --save
Demo
http://idiotwu.github.io/angular-smooth-scrollbar/
Usage
-
Include all dependencies in your page file:
<link rel="stylesheet" href="smooth-scrollbar/dist/smooth-scrollbar.css">
<script src="angular.js"></script>
<script src="smooth-scrollbar/dist/smooth-scrollbar.js"></script>
<script src="angular-smooth-scrollbar/dist/angular-smooth-scrollbar.js"></script>
-
Add SmoothScrollbar
as dependency to your angular app:
angular.module('myApp', ['SmoothScrollbar']);
-
Use it wherever you want:
Available Options
parameter | type | default | description |
---|
speed | Number | 1 | Scrolling speed scale. |
friction | Number | 10 | Scrolling friction, a percentage value within (1, 100). |
thumbMinWidth | Number | 20 | Minimal size for horizontal thumb. |
thumbMinHeight | Number | 20 | Minimal size for vertical thumb. |
ignoreEvents | Array | [] | Details here. |
Confusing with the option field? Try edit tool here!
ScrollbarServiceProvider
You can configure default scrollbar behavior here:
angular.module('myApp', ['SmoothScrollbar'])
.config((ScrollbarServiceProvider) => {
});
ScrollbarServiceProvider.setDefaultOptions( options )
Set default scrollbar options for your angular app.
ScrollbarService
By given scrollbar a name via attribute, you can access your scrollbar instances through ScrollbarService
.
ScrollbarService.generateName()
Return a timestamp string, this will be useful while trying naming scrollbars uniquely.
ScrollbarService.getInstance( name )
Get scrollbar instance by giving the name, and return a promise with instance.
ScrollbarService.destroyInstance( name )
Remove all event listeners on the named instance, but will not remove scrollbar from DOM.
APIs
Documents
License
MIT.