jQuery: The Write Less, Do More JavaScript Library

Events/load

From jQuery JavaScript Library

Jump to: navigation, search

« Back to Events

load( fn )

Binds a function to the load event of each matched element.
When bound to the window element, the event fires when the user agent finishes loading all content within a document, including window, frames, objects and images. For elements, it fires when the target element and all of its content has finished loading.
Arguments:
fnFunction
A function to bind to the load event on each of the matched elements.
function callback(eventObject) {
  this; // dom element
}

Run a function when the page is fully loaded including graphics.

    $(window).load(function () {
      // run code
    });