Biblioteca de zoom de imagen de JavaScript puro-Zoomer. js
| Autor: | vkammerer |
|---|---|
| Views Total: | 3,292 |
| Sitio oficial: | Ir a la web |
| Actualizado: | May 10, 2016 |
| Licencia: | MIT |
Vista prévia
Descripción
Zoomer. js es una biblioteca JavaScript libre de dependencia que proporciona acercar y alejar las funcionalidades de las imágenes.
¿Cómo funciona?
Sólo tiene que incluir la biblioteca Zoomer. js en la página HTML y estamos listos para ir.
<script src="zoomer.js"></script>
Cree un contenedor DIV para el Zoomer.
<div id="zoomerElement"> Loading images... </div>
Cree un nuevo objeto Zoomer con opciones.
var myZoomer = new Zoomer({
selector: '#zoomerElement',
width: 960,
height: 540,
stepsPerLevel: 20,
step: 0,
opacityTransitionDuration: 200,
images: [{
src: '1.png',
level: 0,
}, {
src: '2.png',
level: 2,
}, {
src: '3.png',
level: 4,
}]
}); API methods.
// set the zoom level // arguments: 'step' and 'stepsPerLevel' myZoomer.setZoom(arg) // animate zoom // arguments: 'step', 'toStep', 'animationPromiseResolve', 'animationDirection' and 'stepsPerLevel' myZoomer.animateZoom(arg)





