Skip to content

Commit

Permalink
Updated page-params.html
Browse files Browse the repository at this point in the history
  • Loading branch information
jemimaabu committed Jun 20, 2024
1 parent 1d5e060 commit eccf449
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions page-params.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
margin-top: 0;
}

.hidden {
.paginated-list li:not(.active) {
display: none;
}

Expand Down Expand Up @@ -84,7 +84,7 @@
<body>
<main>
<h1>Updating Page Query with Vanilla JavaScript</h1>
<ul id="paginated-list" data-current-page="1" aria-live="polite">
<ul class="paginated-list" id="paginated-list" data-current-page="1" aria-live="polite">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
Expand Down Expand Up @@ -229,9 +229,9 @@ <h1>Updating Page Query with Vanilla JavaScript</h1>
const currRange = pageNum * paginationLimit;

listItems.forEach((item, index) => {
item.classList.add("hidden");
item.classList.remove("active");
if (index >= prevRange && index < currRange) {
item.classList.remove("hidden");
item.classList.add("active");
}
});
};
Expand Down

0 comments on commit eccf449

Please sign in to comment.