https://github.com/tinydesk/angular-scroll-rtl
Provides an abstraction layer to compensate for browser differences in handling scrollLeft in RTL mode
https://github.com/tinydesk/angular-scroll-rtl
Last synced: 22 days ago
JSON representation
Provides an abstraction layer to compensate for browser differences in handling scrollLeft in RTL mode
- Host: GitHub
- URL: https://github.com/tinydesk/angular-scroll-rtl
- Owner: tinydesk
- License: mit
- Created: 2016-07-06T13:54:19.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-21T18:47:31.000Z (about 8 years ago)
- Last Synced: 2026-01-23T19:39:17.416Z (about 2 months ago)
- Language: HTML
- Size: 8.79 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# angular-scroll-rtl
Provides an abstraction layer to compensate for browser differences in handling scrollLeft in RTL mode.
## Get Started
Install via bower:
```
bower install angular-scroll-rtl --save
```
Add dependency:
```javascript
angular.module('myApp', ['td.scroll']);
```
Make sure that `dist/angular-scroll-rtl.js` is included in your html file.
## Usage
The module will extend the `angular.element` prototype by adding the following methods:
### scrollLeft(value)
The behaviour is similar to the corresponding [jQuery method](https://api.jquery.com/scrollleft/). The difference is, that it will account for browser discrepancies that occur when the element's direction is set to right-to-left. In this case, it will always return the right-most position as 0, whereas the left-most position is the maximum scroll value.
### direction(value)
When provided with no value, returns the currently effective direction setting for the element. When a value is present, the direction of the element will be set to the specified value.