jQuery 1.0.2

2019-06-03 18:50:05于海丽


            // If we actually just moused on to a sub-element, ignore it
            if ( p == this ) return false;

            // Execute the right function
            return (e.type == "mouseover" ? f : g).apply(this, [e]);
        }

        // Bind the function to the two event listeners
        return this.mouseover(handleHover).mouseout(handleHover);
    },
    ready: function(f) {
        // If the DOM is already ready
        if ( jQuery.isReady )
            // Execute the function immediately
            f.apply( document );

        // Otherwise, remember the function for later
        else {
            // Add the function to the wait list
            jQuery.readyList.push( f );
        }

        return this;
    }
});

jQuery.extend({
    /*
     * All the code that makes DOM Ready work nicely.
     */
    isReady: false,
    readyList: [],

    // Handle when the DOM is ready
    ready: function() {
        // Make sure that the DOM is not already loaded
        if ( !jQuery.isReady ) {
            // Remember that the DOM is ready
            jQuery.isReady = true;