floaty.js
v1.0.2
Published
Floaty is a lightweight, vanilla JS `floating element` library.
Downloads
3
Readme
Floaty.js
Floaty is a lightweight, vanilla JS floating element
library.
Screenshot
Features
- Create multiple floating elements in one page.
- Multiple config options.
Installation
To install Floaty, follow these steps:
<script src="./floaty.js"></script>
Usage
To use Floaty, follow these steps:
Floaty();
Floaty({
/*configure*/
});
Configure
Floaty({
speed: 100, // Move speed
statuX: 1, // Range of motion X
statuY: 1, // Range of motion Y
randomStatus: false, // Random range of motion
x: 10, // Initial position X
y: 10, // Initial position Y
randomPosition: false, // Random initial position
closeButton: false, // Close button
img: "https://placehold.co/300x300/000/fff", // Image URL
});
License
Floaty is released under the MIT License