Web Development with jQuery®

(Elliott) #1

Appendix C (^) ❘ 503
bapp03.indd 02/17/2015 Page 503
each(function(key,
value))
Executes a callback function for every ele-
ment in a selection.
As with most jQuery callback functions,
this refers to the current element within
the callback function, and the callback func-
tion is provided the argument list:
offset, element.
Returning true from the callback function
provides a result similar to a continue state-
ment. Returning false provides a result simi-
lar to a break statement.
jQuery
$(Array).each(
function(key, value)
)
$.each(Array, function)
$.each(Object, function)
Executes a callback function for every ele-
ment in an array.
As with most jQuery callback functions, this
refers to the current item within the callback
function, and the callback function is provided
the argument list: key, value.
Returning true from the callback function
provides a result similar to a continue state-
ment. Returning false provides a result simi-
lar to a break statement.
Object
end() Ceases any fi ltering that took place and
returns the current selection to its previous
state.
jQuery
eq(index) Reduces a selection to a single element,
where index is the number representing the
element’s position in the selection offset from
zero.
jQuery
eq(-index) Reduces a selection to a single element,
where index is a negative number represent-
ing the element’s position from the last ele-
ment in the selection.
jQuery
filter(selector) Removes all elements that do not match the
specifi ed selector.
jQuery
continues
http://www.it-ebooks.info

Free download pdf