Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

way2web-click-limit

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

way2web-click-limit

Disable the element on a click limit.

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
48
increased by26.32%
Maintainers
1
Weekly downloads
 
Created
Source

Click Limit package

With this package you can set a limit on how many times you can click on the element.

Installation

npm install way2web-click-limit

Basic Usage

var element = $('.js-limited-click:first');
var test = new ClickLimit(element).init();

You can set a data attribute click-max to the element, to set the click limit. The default value is 1, so you can click the element only one time.

.click()

This function will called when you click on the element. A variable clicked will be increased by 1. The property disabled will be set on the element.

.unlock()

You can call this function to reset the clicks on the element, so you can click again on the element. The variable clicked will be set to 0. The property disabled will be removed from the element.

.getClicked()

This function returns how many times you have clicked on the element.

.getMax()

This function returns how many times you can click on the element.

Test the package.

npm run lint This will only lint your scripts.

npm test

This will run all the tests in the test folder with mocha.

Keywords

FAQs

Package last updated on 12 Sep 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc