Guest User

Untitled

a guest
Nov 23rd, 2017
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. (function ($) {
  2. /* Twitter Bootstrap Message Helper
  3. ** Usage: Just select an element with `alert` class and then pass this object for options.
  4. ** Example: $("#messagebox").message({text: "Hello world!", type: "error"});
  5. ** Author: Afshin Mehrabani <afshin.meh@gmail.com>
  6. ** Date: Monday, 08 October 2012
  7. */
  8. $.fn.message = function(options) {
  9. //remove all previous bootstrap alert box classes
  10. this[0].className = this[0].className.replace(/alert-(success|error|warning|info)/g , '');
  11. this.html(options.text).addClass("alert-" + (options.type || "warning"));
  12. this.show();
  13. };
  14. })(jQuery);
Add Comment
Please, Sign In to add comment