Skip to content

make element scalable by mouse wheel. it can take the current mouse position as the transform origin.

Notifications You must be signed in to change notification settings

joyfulljs/scalable

Repository files navigation

make element scalable by mouse wheel

useage

import Scalable from '@joyfulljs/scalable';

// ...
mount(){
  this.instance = new Scalale(this.refs.el, {
    followMouse: true,
    maxScale: 5,
    minScale: 1,
    onScaleChange: ( { scale } )=>{ console.log(scale) }
  });
},
active(){
  // if need to reset to origin state
  this.instance.reset()
},
unmount(){
  this.instance.destroy()
}
// ...

api

docs

LICENSE

MIT

About

make element scalable by mouse wheel. it can take the current mouse position as the transform origin.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published