Skip to content

Latest commit

 

History

History
52 lines (36 loc) · 1.53 KB

README.md

File metadata and controls

52 lines (36 loc) · 1.53 KB

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

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

Example

demo