Skip to content

strivefighting/fy-shop-move

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A simple shopping cart animation effect

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published