jQuery Plugin To Display Daily Predefined Messages - Daily Messages

jQuery Plugin To Display Daily Predefined Messages - Daily Messages
File Size: 8.75 KB
Views Total: 627
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Daily Messages is a jQuery plugin that automatically displays a daily predefined message based on the day of the week.

How to use it:

1. Put the jQuery daily messages plugin after jQuery JavaScript library like this:

<script src="//code.jquery.com/jquery.min.js"></script>
<script src="src/dailyMessages.js"></script>

2. Create a container element where you want to place the messages.

<div class="daily-message"></div>

3. Call the function and define the different messages for each day of the week.

$('.daily-message').dailyMessages({
  monday: "Get Motivated",
  tuesday: "Get Down to Business",
  wednesday: "Keep it Going",
  thursday: "Reflect on All You've Done",
  friday: "Conquer Your Fears",
  saturday: "Prep for Success",
  sunday: "Prep for Success"
});

4. Callback functions.

$('.daily-message').dailyMessages({
  success: function() {
    console.log('It worked!');
  },
  error: function(message) {
    console.log(message);
    $(this).remove();
  }
});

This awesome jQuery plugin is developed by michael-lynch. For more Advanced Usages, please check the demo page or visit the official website.