Socket
Socket
Sign inDemoInstall

easy-float

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    easy-float

Easy Float


Version published
Maintainers
1
Install size
11.4 kB
Created

Readme

Source

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

Keywords

FAQs

Last updated on 19 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc