jQuery 1.0.4 - New Wave Javascript(js源文件)

2019-06-03 09:49:42刘景俊

        },

        toggleClass: function( c ){
            jQuery.className[ jQuery.className.has(this,c) ? "remove" : "add" ](this, c);
        },


        remove: function(a){
            if ( !a || jQuery.filter( a, [this] ).r )
                this.parentNode.removeChild( this );
        },

        empty: function(){
            while ( this.firstChild )
                this.removeChild( this.firstChild );
        },

        bind: function( type, fn ) {
            jQuery.event.add( this, type, fn );
        },


        unbind: function( type, fn ) {
            jQuery.event.remove( this, type, fn );
        },

        trigger: function( type, data ) {
            jQuery.event.trigger( type, data, this );
        }
    }
};

jQuery.init();
jQuery.fn.extend({

    // We're overriding the old toggle function, so
    // remember it for later
    _toggle: jQuery.fn.toggle,
    toggle: function(a,b) {
        // If two functions are passed in, we're
        // toggling on a click
        return a && b && a.constructor == Function && b.constructor == Function ? this.click(function(e){
            // Figure out which function to execute