Guest

Untitled

By: a guest on Jan 28th, 2012  |  syntax: None  |  size: 0.34 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. (function($){
  2.  
  3.   $.fn.check = function(){
  4.     if (!this.is(':checked')) {
  5.       this.toggleChecked();
  6.     }
  7.     return this;
  8.   };
  9.  
  10.   $.fn.uncheck = function(){
  11.     if (this.is(':checked')) {
  12.       this.toggleChecked();
  13.     }
  14.     return this;
  15.   };
  16.  
  17.   $.fn.toggleChecked = function(){
  18.     this.click().change();
  19.     return this;
  20.   };
  21.  
  22. })(jQuery);