Kcko
3/15/2018 - 1:15 PM

Jquery slice - gt, lt like functions

$("li").slice(0,4); // :lt(4)
$("li").slice(5); // :gt(4)

$.fn.lt = function(n) {return this.slice(0,n);};
$.fn.gt = function(n) {return this.slice(n+1);};