Skip to content

55sketch/scheduled-content-plugin

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
js
 
 
 
 
 
 
 
 

scheduled-content-plugin

A JQuery plugin to show or hide content based on date and time.

Installation

Download and include the plugin after including JQuery, at the bottom of your HTML file:

<!-- Include JQuery -->

<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<!-- Include Plugin -->

<script src="js/scheduled-content.js"></script>

Usage

Using the plugin, you can specify a start date, and end date, or both.

Start Date Only:

This will show the content only after a certain date.

<script>
	$('#selector').scheduleContent({
	start:'12/26/2014'
	});
</script>

End Date Only:

This will show the content only before a certain date.

<script>
	$('#selector').scheduleContent({
	end:'12/26/2014'
	});
</script>

Start And End Date:

This will show the content between two dates.

<script>
	$('#selector').scheduleContent({
	start:'12/26/2014',
	end:'12/31/2014'
	});
</script>

Date format

You can enter dates in any format accepted by javascript

Please see demo.html for a fully worked up example based on The Twelve Days Of Christmas

About

A JQuery plugin to show or hide content based on date and time.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published