diff --git a/items_2.css b/items_2.css index 9bdfc91..f23e295 100644 --- a/items_2.css +++ b/items_2.css @@ -114,3 +114,26 @@ margin: 0 0 14px; } } + +#scroll-up { + width: 10vw; + height: 10vw; + bottom: 4vw; + right: 4vw; + position: fixed; + display: none; + background-color: #212121; + font-size: 12pt; + font-weight: bold; + text-align: center; + line-height: 10vw; + border: 1px solid #666; + cursor: pointer; + user-select: none; +} + +@media(max-width: 1099px) { + #scroll-up { + display: block; + } +} diff --git a/items_2.html b/items_2.html index f0650c1..24a4c38 100644 --- a/items_2.html +++ b/items_2.html @@ -58,6 +58,7 @@ + diff --git a/items_2.js b/items_2.js index 656a731..1f846ed 100644 --- a/items_2.js +++ b/items_2.js @@ -404,6 +404,10 @@ function init_items2() { // focus the query filter text box searchFilterField.field.focus(); searchFilterField.field.select(); + + // scroll-to-top button + document.getElementById('scroll-up') + .addEventListener('mousedown', e => scrollTo({ top: 0, behavior: 'smooth' })); } load_init(init_items2);