add Ox..toggleClass() method

This commit is contained in:
rolux 2013-01-08 11:51:12 +01:00
parent 728fc69fb5
commit d7f54bc7e4

View file

@ -251,6 +251,16 @@ Ox.$ = Ox.element = function(value) {
return this.css({display: 'block'});
},
/*@
toggleClass <f> Toggles a class name
(className) -> <o> This element
className <s> Class name
@*/
toggleClass: function(string) {
return this[
this.hasClass(string) ? 'removeClass' : 'addClass'
](string);
},
/*@
trigger <f> Triggers an event
(event) -> <o> This element
@*/