Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kanety/stimulus-zoom-image
https://github.com/kanety/stimulus-zoom-image
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kanety/stimulus-zoom-image
- Owner: kanety
- License: mit
- Created: 2022-08-28T00:34:54.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-27T07:31:08.000Z (7 months ago)
- Last Synced: 2024-10-03T07:19:09.533Z (4 months ago)
- Language: JavaScript
- Size: 23.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# stimulus-zoom-image
A stimulus controller for zooming an image.
## Dependencies
* @hotwired/stimulus 3.0+
## Installation
Install from npm:
$ npm install @kanety/stimulus-zoom-image --save
## Usage
Register controller:
```javascript
import { Application } from '@hotwired/stimulus';
import ZoomImageController from '@kanety/stimulus-zoom-image';const application = Application.start();
application.register('zoom-image', ZoomImageController);
```Build html as follows:
```html
```When your mouse is over the container, the image is zoomed in its original size.
If the original size of the image is smaller than the container, the image is not zoomed.## License
The library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).