Skip to content

michael-lynch/daily-messages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Daily Messages

Inspired by Basecamp, Daily Messages is a simple, lightweight jQuery plugin used to display a custom message for each day of the week.

See a demo

##Instructions

Include jQuery and the plugin in the head or footer of your page.

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="/js/plugins/dailyMessages.min.js"></script>

Initialize the plugin targeting the class, ID or element that you want the daily message to be inserted into and send the plugin your custom messages for each day.

$('.daily-message').dailyMessages({
	monday: "Case of the Mondays?",
	tuesday: "I know it's only Tuesday, but you can do it! ",
	wednesday: "Hump day baby!",
	thursday: "We all know Thursday is the new Friday.",
	friday: "Thank God! We made it. Happy Friday folks!",
	saturday: "It's Saturday fool! Stop using the Internets and go outside!",
	sunday: "NFL Sunday! Or maybe some Netflix? Chill.",
	success: function() {
		console.log('It worked!');
	},
	error: function(message) {
		console.log(message);
		$(this).remove();
	}
});

####Options

  1. monday: ""
    A string that defines the message that will be displayed on Mondays (default: `null`).
  2. tuesday: ""
    A string that defines the message that will be displayed on Tuesdays (default: `null`).
  3. wednesday: ""
    A string that defines the message that will be displayed on Wednesdays (default: `null`).
  4. thursday: ""
    A string that defines the message that will be displayed on Thursdays (default: `null`).
  5. friday: ""
    A string that defines the message that will be displayed on Fridays (default: `null`).
  6. saturday: ""
    A string that defines the message that will be displayed on Saturdays (default: `null`).
  7. sunday: ""
    A string that defines the message that will be displayed on Sundays (default: `null`).
  8. success: function()
    A callback function that runs if Daily Messages is successfull (default: `function()`).
  9. error: function(message)
    A callback function that runs if Daily Messages fails (default: `function(message)`).

About

A simple, lightweight jQuery plugin used to display a custom message for each day of the week.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published