-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathjquery.ish.min.js
4 lines (4 loc) · 1.23 KB
/
jquery.ish.min.js
1
2
3
4
var $=function(a){var a=(new $.fn.init(a)).elm,b;for(b in $.fn)if("init"!=b||"elm"!=b)a[b]=$.fn[b];return a};
$.fn={init:function(a){$.fn.elm="string"==typeof a?document.querySelectorAll(a):a.length?a:[a];return this},hasClass:function(a){var b;for(b=0;b<this.length;b++){var d=this[b].className.split(" "),c;for(c in d)if(d[c]==a)return!0}return!1},addClass:function(a){var b;for(b=0;b<this.length;b++)-1==(" "+this[b].className+" ").indexOf(" "+a+" ")&&(this[b].className=(this[b].className+" "+a).replace(/^\s\s*/,"").replace(/\s\s*$/,""));return this},toggleClass:function(a){var b;for(b=0;b<this.length;b++)this.hasClass(a)?
this.removeClass(a):this.addClass(a);return this},removeClass:function(a){var b;for(b=0;b<this.length;b++){var d=this[b].className.split(" "),c;for(c=0;c<d.length;c++)d[c]==a&&delete d[c];this[b].className=d.join(" ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}return this},toggle:function(){var a;for(a=0;a<this.length;a++)this[a].style.display="none"==window.getComputedStyle(this[a]).display?"block":"none";return this},hide:function(){var a;for(a=0;a<this.length;a++)this[a].style.display="none";return this},
show:function(){var a;for(a=0;a<this.length;a++)this[a].style.display="block";return this}};$.fn.init.prototype=$.fn;