From 1a693d3fea311f0ee9e3368bf6d6f68de7536b0e Mon Sep 17 00:00:00 2001 From: wataori Date: Fri, 9 Jan 2015 20:56:48 +0900 Subject: [PATCH] #129 add functions .gt() and .lt() --- lib/api/traversing.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/api/traversing.js b/lib/api/traversing.js index 0c4341de591..33d9b70bc52 100644 --- a/lib/api/traversing.js +++ b/lib/api/traversing.js @@ -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) {