You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

easy-float

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-float

Easy Float

1.0.3
latest
Source
npmnpm
Version published
Weekly downloads
1
-83.33%
Maintainers
1
Weekly downloads
 
Created
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

Easy

FAQs

Package last updated on 19 Apr 2024

Did you know?

Socket

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