私信  •  关注

Christian Haller

Christian Haller 最近创建的主题
Christian Haller 最近回复了
14 年前
回复了 Christian Haller 创建的主题 » jquery开关盒插件?
    (function($) {
    $.fn.switchClasses = function(switches) {
        return this.each(function() {
            var that = this;
            $.each(this.attr("class").split(' '), function(i, classname) {
                var func = switches[classname];
                if(func){
                    func.apply(that, classname);
                }
            });
        });
    };
})(jQuery);

“class”是保留名称, 我加了一些缺少的括号