Socket
Socket
Sign inDemoInstall

shift-js

Package Overview
Dependencies
65
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    shift-js

Use the shift key to select a range of elements, such as checkboxes and radio buttons.


Version published
Weekly downloads
8
decreased by-27.27%
Maintainers
1
Install size
7.47 MB
Created
Weekly downloads
 

Readme

Source

Shift.js

Use the shift key to select a range of elements, such as checkboxes and radio buttons.

 

Mimics Gmail's checkbox filter where you hold down the shift key to select ranges.

Install with npm: npm install shift-js.
…We're on Bower as well: bower install shift-js.

Getting Started

Shift requires the adding of an attribute to each checkbox to specify its group. With this you can specify unique groups for your collection of checkboxes – allowing you to have multiple checkbox collections per page.

<input type="checkbox" data-shift-group="groupOne" />
<input type="checkbox" data-shift-group="groupOne" />
<input type="checkbox" data-shift-group="groupOne" />

<input type="checkbox" data-shift-group="groupTwo" />
<input type="checkbox" data-shift-group="groupTwo" />
<input type="checkbox" data-shift-group="groupTwo" />

Setting up two unique groups (groupOne and groupTwo) allows both to act independently of one another. If you intersperse the checkboxes then it tends to make more sense – because checkboxes of another group will be let well alone.

Once you've setup your DOM there is nothing else to do – Shift will setup the behaviour automatically!

Keywords

FAQs

Last updated on 20 Nov 2013

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