It is loaded on clicking prev button. I want to disable this button when there is no more articles. Preferably i would like button to disappear.
function getPrev(item, article) {
for (var i = 0, len = article.length; i < len; i++) {
if (article[i].id === item) {
return (i - 1 >= 0) ? article[i - 1] : null;
}
}
Thanks