jQuery 1.0.4 New Wave Javascript(js源文件)

2020-05-19 07:32:46易采站长站整理

            // Clone the structure that we’re using to wrap
            var b = a[0].cloneNode(true);
            // Insert it before the element to be wrapped
            this.parentNode.insertBefore( b, this );
            // Find the deepest point in the wrap structure
            while ( b.firstChild )
                b = b.firstChild;
            // Move the matched element to within the wrap structure
            b.appendChild( this );
        });
    },

    append: function() {
        return this.domManip(arguments, true, 1, function(a){
            this.appendChild( a );
        });
    },

    prepend: function() {
        return this.domManip(arguments, true, -1, function(a){
            this.insertBefore( a, this.firstChild );
        });
    },

    before: function() {
        return this.domManip(arguments, false, 1, function(a){
            this.parentNode.insertBefore( a, this );
        });
    },

    after: function() {
        return this.domManip(arguments, false, -1, function(a){
            this.parentNode.insertBefore( a, this.nextSibling );
        });
    },
    end: function() {
        if( !(this.stack && this.stack.length) )