Skip to content

Commit

Permalink
pages fix
Browse files Browse the repository at this point in the history
  • Loading branch information
drunkwolfs committed Jun 22, 2024
1 parent 0c72018 commit 4437991
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
const users = getDecompressedJsonParam('users');
const items = getDecompressedJsonParam('items');



//Навигация
var pages = ['item_page.html', 'user_page.html'];
var currentPage = 0;
Expand All @@ -62,16 +60,6 @@
document.getElementById('content').innerHTML = '<p>Ошибка загрузки страницы.</p>';
});
}
document.getElementById('prev').addEventListener('click', () => {
if (currentPage > 1) {
currentPage--;
loadContent(currentPage);
}
});
document.getElementById('next').addEventListener('click', () => {
currentPage++;
loadContent(currentPage);
});
// Загружаем начальный контент
loadContent(currentPage);
</script>
Expand All @@ -89,6 +77,17 @@
<td><button id="next">Далее</button></td>
</tr>
</table>
<script>
document.getElementById('prev').addEventListener('click', () => {
if (currentPage > 1) {
currentPage--;
loadContent(currentPage);
}
});
document.getElementById('next').addEventListener('click', () => {
currentPage++;
loadContent(currentPage);
});</script>
</body>

</html>

0 comments on commit 4437991

Please sign in to comment.