1.0.2 • Published 2 years ago

fy-shop-move v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

fy-shop-move

NPM version NPM Weekly Downloads License

A simple shopping cart animation effect

Install with npm, or Yarn:

# 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

PropertyTypeRequired?Description
clickEleHTMLElementElements of starting animation
storeEleHTMLElementElements of ending animation
moveHTMLStringAnimation element html string
moveEleSizeNumberAnimation element size, width and height are consistent; Unit: px
moveEndCallbackFunctionAnimation end callback function

Example

demo