Socket
Socket
Sign inDemoInstall

floating-action

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    floating-action

This custom element will create a floating action button.


Version published
Weekly downloads
21
increased by110%
Maintainers
1
Install size
29.4 kB
Created
Weekly downloads
 

Readme

Source

Float action

This custom element will create a floating action button. When hover over the element it will reveal the hidden menu. This is a touch event on touch devices

Demo

Demo

Install

Install the component using NPM:

$ npm install floating-action --save

Dependencies

Custom element polyfill

https://github.com/WebReflection/document-register-element

classList polyfill

https://www.npmjs.com/package/classlist

Usage

Add Custom Element Script:

<script src="../dist/float-action.js"></script>

Start using it!

<cs-floatingaction button=".c-floating__button" container=".c-floating__nav" toggle="c-floating__nav--show" move-element="c-floating--offbottom" to-bottom="10">

    <nav class="c-floating__nav">
        <a href="" class="c-floating__link">
            <span class="glyphicon glyphicon-eye-open"></span> View reminders
        </a>
        <a href="" class="c-floating__link">
            <span class="glyphicon glyphicon-calendar"></span> Create reminder
        </a>
    </nav>

    <a href="" class="c-floating__button">
        <i class="material-icons md-36 c-floating__icon">add</i>
    </a>

</cs-floatingaction>

##Options

AttributeOptionsDefaultDescription
buttonCss SelectornullThis is required. Its the class on the icon that is allow aways visible.
containerCss SelectornullThis is required. Its the container that is hidden containing the links
toggleStringnullThis is required. This is the name of the class that needs to be added to display the container
move-elementStringnullIf required to move the custom element of the bottom of the window. This is the class that will be added or remove when scroll off the bottom on the window
to-bottomString0How far from the bottom of the window should the 'move-element' class be added or removed

Keywords

FAQs

Last updated on 05 Jun 2017

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