1.2.0 • Published 3 years ago

floating-container v1.2.0

Weekly downloads
7
License
MIT
Repository
github
Last release
3 years ago

Floating Container

A simple floating for your any container. This library doesn't have any dependencies and can be used with any webpage.

CDN Links:

https://cdn.jsdelivr.net/npm/floating-container@latest/src/js/floating-container.min.js
https://cdn.jsdelivr.net/npm/floating-container@latest/src/css/floating-container.min.css

NPM

npm i floating-container

https://www.npmjs.com/package/floating-container

Usage

  import FloatingContainer from "../src/js/floating-container.min.js";

  const fc = new FloatingContainer({
    container: '#fc-container',
    wrapper: '#fc-wrapper',
    selector: '#fc-selector',
    direction: 'bottom-right',
    escapeHeight: 50,
    showControllers: true,
    observerOptions: { threshold: 0 },
    onCloseFC: () => { },
    onPutBackFC: () => { },
    startPreviewFC: () => {},
    endPreviewFC: () => {},
    notSupportedCallback: () => { },
  });

Parameters

NameTypeDefaultDescription
containerstring"#fc-container"Container field selector
wrapperstring"#fc-wrapper"Wrapper field selector
selectorstring"#fc-selector"Selector field selector
directionstring"bottom-right"Floating position enum
escapeHeightnumber50The escape field to be created for scroll when canceling floating operation (px)
showControllersbooleantrueControl field will be added
observerOptionsobject{ threshold: 0 }Intersection Observer options
onCloseFCfunction() => {}Runs when 'close' is triggered
onPutBackFCfunction() => {}Runs when 'put back' is triggered
startPreviewFCfunction() => {}Runs when 'float container' is triggered
endPreviewFCfunction() => {}Runs when 'float container' is prevented
notSupportedCallbackfunction() => {}If this code doesn't support it will be triggered
1.2.0

3 years ago

1.1.1

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago