Keep scroll-to-top button within container

This commit is contained in:
Chris Kankiewicz
2020-01-20 21:24:21 -07:00
parent 8f1923b720
commit 7bab5a5ac6

View File

@@ -1,6 +1,10 @@
<a id="scroll-to-top"
class="flex justify-center items-center w-12 h-12 fixed bottom-0 right-0 rounded-full shadow-lg bg-blue-600 text-white cursor-pointer p-2 m-10 hover:bg-blue-700 hidden"
onclick="window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });" title="Scroll to Top"
>
<i class="fas fa-arrow-up fa-lg"></i>
</a>
<div class="fixed bottom-0 left-0 right-0 pointer-events-none">
<div class="container flex justify-end mx-auto px-4 py-10">
<a id="scroll-to-top"
class="flex justify-center items-center w-12 h-12 right-0 rounded-full shadow-lg bg-blue-600 text-white cursor-pointer pointer-events-auto hover:bg-blue-700 hidden"
onclick="window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });" title="Scroll to Top"
>
<i class="fas fa-arrow-up fa-lg"></i>
</a>
</div>
</div>