Skip to content

Commit

Permalink
cheeriojs#129 add functions .gt() and .lt()
Browse files Browse the repository at this point in the history
  • Loading branch information
wataori committed Jan 9, 2015
1 parent bbd2e1f commit 1a693d3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/api/traversing.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,22 @@ exports.eq = function(i) {
return this[i] ? this._make(this[i]) : this._make([]);
};

exports.gt = function(i) {
var matchIndexes = [];
for (i; i < this.length; i++ ) {
matchIndexes.push(this[i]);
}
return matchIndexes;
};

exports.lt = function(i) {
var matchIndexes = [];
for (var j = 0; j < i; j++ ) {
matchIndexes.push(this[j]);
}
return matchIndexes;
};

// Retrieve the DOM elements matched by the jQuery object.
exports.get = function(i) {
if (i == null) {
Expand Down

0 comments on commit 1a693d3

Please # to comment.