1.0.3 • Published 1 year ago

easy-float v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Install

npm i easy-float

example:

import EasyFloat from 'easy-float';
const container = document.querySelector('body');
const targetBtn = document.querySelector('.btn');

const easyFloat = new EasyFloat();
const container = document.querySelector('body');
const targetBtn = document.querySelector('.btn');
easyFloat.init({
  container,
  targetBtn,
  padding: 10,
  initBottom: 10,
  initLeft: 10,
  fadeOutEnable: true,
  fadeOutTime: 1000,
});
targetBtn.addEventListener('click', () => {
  if (!easyFloat.canClick) return;
  alert('do click');
});

options

paramstypedefaultdesc
options.containerHTMLElementcontainer area
options.targetBtnHTMLElementfloating button
options.paddingnumber10distance from edge
options.initTopnumber0Initialize the distance from the top border
options.initBottomnumbernullInitialize the distance from the bottom border
options.initLeftnumber0Initialize the distance from the left border
options.initRightnumbernullInitialize the distance from the right border
options.fadeOutEnablebooleanfalseWhether to allow hiding
options.fadeOutTimenumber4000Hide delay, Effective when options.fadeOutEnable is true
1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago