Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kanety/stimulus-zoom-image


https://github.com/kanety/stimulus-zoom-image

Last synced: 2 months ago
JSON representation

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).