Skip to content

55sketch/scheduled-content-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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