1.0.2 • Published 2 years ago
fy-shop-move v1.0.2
fy-shop-move
A simple shopping cart animation effect
# via npm
npm install fy-shop-move --save
# or Yarn (note that it will automatically save the package to your `dependencies` in `package.json`)
yarn add fy-shop-move
Usage
import MoveFactory from 'fy-shop-move';
import 'fy-shop-move/style';
MoveFactory.create({
clickEle: document.querySelector('.click'),
storeEle: document.querySelector('.store'),
moveHTML: `<div class="plus">+</div>`,
moveEleSize: 30,
moveEndCallback: () => {
console.log('move end.')
}
})
Params
Property | Type | Required? | Description |
---|---|---|---|
clickEle | HTMLElement | ✓ | Elements of starting animation |
storeEle | HTMLElement | ✓ | Elements of ending animation |
moveHTML | String | ✓ | Animation element html string |
moveEleSize | Number | ✓ | Animation element size, width and height are consistent; Unit: px |
moveEndCallback | Function | Animation end callback function |