Skip to content

Kreshnik/expireAt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. Include jQuery:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
  2. Include plugin's code:

    <script src="jquery.expireAt.min.js"></script>
  3. 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>
  4. 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
    	}
    });

Contains a simple HTML file to demonstrate the plugin.

This is where the source code is stored.

About

expireAt is a plugin that helps you track html elements, that have to expire on a specific time.

Resources

Stars

Watchers

Forks

Packages

No packages published