Daily Messages: jQuery Custom Message Plugin

Shares

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

Example: (The message below changes based on the day of the week.)


Usage:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$('.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();
	}
});

WordPress Compatibility Mode:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
jQuery('.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();
	}
});
Subscribe to the JqueryPlugins.net mailing list:

* indicates required

Reply

Pin It on Pinterest