1.0.3 • Published 10 years ago
expireat v1.0.3
jQuery expireAt
About
The plugins purpose is to help you indicate once an html element has to expire. Once an expire date has been reached, a class will be added expireAt-expired
to the element. As well as a callback function will be executed.
Usage
Include jQuery:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
Include plugin's code:
<script src="jquery.expireAt.min.js"></script>
Add the
data-expire-at
attribute with the expiration date to the elements you want to expire:<tr class="element" data-expire-at='2015-03-06 14:09:09'></tr>
Call the plugin:
$(".element").expireAt({ interval: 60000, // Set an custom interval you want the plugin to iterate through the elements. The default is 60 seconds callback: function(element){ console.warn('Expired:', element); // You can use this callback function to handle the expired element } });
demo/
Contains a simple HTML file to demonstrate the plugin.
src/
This is where the source code is stored.