cycling jQuery_Succinctly | Page 38

})(jQuery); The most important thing to grasp here is that you are not limited to the default selectors provided by jQuery. You can create your own. However, before you spend the time creating your own version of a selector, you might just simply try the filter() method with a specified filtering function. For example, I could have avoided writing the :positionAbsolute selector by simply filtering the
elements in my prior example with a function I pass to the filter() method. // Remove
elements from the wrapper // set that are not absolutely positioned $('div').filter(function () { return $(this).css('position') === 'absolute'; }); // or // Remove all elements from the wrapper // set that are not absolutely positioned $('*').filter(function () { return $(this).css('position') === 'absolute'; }); Notes: For additional information about creating your own selectors I suggest the following read: http://www.bennadel.com/blog/1457-How-To-Build-A-Custom-jQuery-Selector.htm Differences between filtering by numeric order vs. DOM relationships jQuery provides filters for filtering a wrapper set by an element’s numerical context within the set. These filters are:        :first :last :even :odd :eq(index) :gt(index) :lt(index) Notes: Filters that filter the wrapper set itself do so by filtering elements in the set at a starting point of 0, or index of 0. For example :eq(0) and :first access the first element in the set—$('div:eq(0)')—which is at a 0 index. This is in contrast to the :nth-child filter that is 38