2.0.0 • Published 2 years ago

floater-dom v2.0.0

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

Floater-Dom

Dom element floating in the box in random direction

Installation

npm install --save floater-dom

Usage

import Floater from 'floater-dom'  

or  

const Floater = require('floater-dom')


//moveBox add style position:absolute

const wrap = document.getElementById('wrap')
const moveBox = document.getElementById('moveBox')
const FloaterObj=new Floater({
    'dom':moveBox,
    "bodyW": wrap.clientWidth,
    "bodyH": wrap.clientHeight,
    'x':20,
    "y":20,
    speed:1 //default 0.5
})

FloaterObj.start()
// FloaterObj.end()

Example

example

2.0.0

2 years ago

1.0.0

2 years ago