.context in JQuery

  Description: The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. version added: 1.3context The .live() method for binding event handlers uses this property to determine the root element to use for its event delegation needs. Plug-ins which perform similar tasks may also find the …

.selector in JQuery

  Description: A selector representing selector originally passed to jQuery(). version added: 1.3selector Should be used in conjunction with context to determine the exact query used. The .live() method for binding event handlers uses this property to determine how to perform its searches. Plug-ins which perform similar tasks may also find the property useful. This …

jQuery.pushStack() in JQuery

  Description: Add a collection of DOM elements onto the jQuery stack. version added: 1.0jQuery.pushStack( elements ) elementsAn array of elements to push onto the stack and make into a new jQuery object. version added: 1.3jQuery.pushStack( elements, name, arguments ) elementsAn array of elements to push onto the stack and make into a new jQuery …

.context in JQuery

  Description: The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. version added: 1.3context The .live() method for binding event handlers uses this property to determine the root element to use for its event delegation needs. Plug-ins which perform similar tasks may also find the …

.scrollTop() in JQuery

  Description: Get the current vertical position of the scroll bar for the first element in the set of matched elements. version added: 1.2.6.scrollTop() The vertical scroll position is the same as the number of pixels that are hidden from view above the scrollable area. If the scroll bar is at the very top, or …

.scrollLeft() in JQuery

  Description: Get the current horizontal position of the scroll bar for the first element in the set of matched elements. version added: 1.2.6.scrollLeft() The horizontal scroll position is the same as the number of pixels that are hidden from view above the scrollable area. If the scroll bar is at the very left, or …

.position() in JQuery

  Description: Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. version added: 1.2.position() The .position() method allows us to retrieve the current position of an element relative to the offset parent. Contrast this with .offset(), which retrieves the current position relative to the document. …

.offset() in JQuery

  .offset() Returns: Object Description: Get the current coordinates of the first element in the set of matched elements, relative to the document. version added: 1.2.offset() The .offset() method allows us to retrieve the current position of an element relative to the document. Contrast this with .position(), which retrieves the current position relative to the …

.toArray() in JQuery

  Description: Retrieve all the DOM elements contained in the jQuery set, as an array. version added: 1.4.toArray() .toArray() returns all of the elements in the jQuery set: alert($(‘li’).toArray()); All of the matched DOM nodes are returned by this call, contained in a standard array: [<li id=”foo”>, <li id=”bar”>] Example: Selects all divs in the …

.size() in JQuery

  Description: Return the number of DOM elements matched by the jQuery object. version added: 1.0.size() <ul> <li>foo</li> <li>bar</li> </ul> We can determine the number of list items by calling .size(): alert(‘Size: ‘ + $(‘li’).size()); This will alert the count of items: Size: 2 The .length property is a slightly faster way to get this …