jQuery Plugin For Triple Clicks Detection - tripleclick

jQuery Plugin For Triple Clicks Detection - tripleclick
File Size: 3.35 KB
Views Total: 889
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

tripleclick is a very small jQuery plugin which listens for triple clicks and triggers an event after you click on an element three times. Click (or touch) three times within 1 second on the element to trigger.

How to use it:

1. The plugin requires jQuery library is loaded properly in the document.

<script src="//code.jquery.com/jquery.min.js"></script>
<script src="tripleclick.js"></script>

2. Fire a function when the user click on a specified element three times in 1 second.

$("#one").on("tripleclick", function() { 
  // do something
});

3. Change the default threshold time.

$("#one").on("tripleclick", { threshold: 5000 }, function() { 
  // do something
});

This awesome jQuery plugin is developed by richadams. For more Advanced Usages, please check the demo page or visit the official website.