I'm using the jQuery .slice()
method to show and hide iterations of a class. The issue i'm having is hiding a button upon reaching the last child this class.
Here is the fiddle - https://jsfiddle.net/carbot3000/syq7s06g/5/
How could I hide the button class 'next' upon reaching last child of class 'review'? You'll see right now that the button is only hidden after clicking 'next' again upon reaching the last child.
if (start + x < size_li) {
rvwList.slice(start, start + x).hide();
start += x;
rvwList.slice(start, start + x).show();
} else if (start + x >= size_li) {
$('.next').hide();`
}