https://github.com/bennycode/knockout-image-rotator
https://github.com/bennycode/knockout-image-rotator
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bennycode/knockout-image-rotator
- Owner: bennycode
- Created: 2014-06-16T19:34:45.000Z (about 11 years ago)
- Default Branch: gh-pages
- Last Pushed: 2014-06-18T16:28:19.000Z (about 11 years ago)
- Last Synced: 2025-03-09T23:12:25.387Z (4 months ago)
- Language: JavaScript
- Homepage: bennyn.github.io/knockout-image-rotator
- Size: 15.3 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Knockout Image Rotater
======================The 'Knockout Image Rotater' can rotate images reading their EXIF orientation values and using Knockout.js bindings.
## Execution ##
```
npm install (package.json)
bower install (bower.json)
```## Usage ##
### Template ###
```html
```### JavaScript ###
```javascript
ImageRotator.init();var viewModel = {
images: ko.observableArray([
new RotatedImage('assets/images/1-up.jpg'),
new RotatedImage('assets/images/2-up-mirrored.jpg'),
new RotatedImage('assets/images/3-down.jpg'),
new RotatedImage('assets/images/4-down-mirrored.jpg'),
new RotatedImage('assets/images/5-left-mirrored.jpg'),
new RotatedImage('assets/images/6-left.jpg'),
new RotatedImage('assets/images/7-right-mirrored.jpg'),
new RotatedImage('assets/images/8-right.jpg')
])
};ko.applyBindings(viewModel, document.getElementById('wrapper'));
```or:
```javascript
ImageRotator.init();var viewModel = {
images: ko.observableArray([])
};viewModel.images().push(new RotatedImage('assets/images/1-up.jpg'));
viewModel.images().push(new RotatedImage('assets/images/2-up-mirrored.jpg'));...
ko.applyBindings(viewModel, document.getElementById('wrapper'));
```