diff --git a/onepagescroll.js b/onepagescroll.js index 2682995..6195e22 100644 --- a/onepagescroll.js +++ b/onepagescroll.js @@ -470,8 +470,10 @@ function onePageScroll(element, options) { var next_index = next.dataset.index; _removeClass(current, "active"); _addClass(next, "active"); - _removeClass(document.querySelector(".onepage-pagination li a" + ".active"), "active"); - _addClass(document.querySelector(".onepage-pagination li a" + "[data-index='" + (page_index) + "']"), "active"); + if(settings.pagination == true) { + _removeClass(document.querySelector(".onepage-pagination li a" + ".active"), "active"); + _addClass(document.querySelector(".onepage-pagination li a" + "[data-index='" + (page_index) + "']"), "active"); + } body.className = body.className.replace(/\bviewing-page-\d.*?\b/g, ''); _addClass(body, "viewing-page-"+ next_index);