No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.js 761B

12345678910111213141516171819
  1. window.addEventListener('DOMContentLoaded', function () {
  2. document.getElementById('backToButton').style.visibility = 'hidden';
  3. document.getElementById('backToButton').addEventListener('transitionend', function () {
  4. if (document.getElementById('backToButton').className !== 'view') {
  5. document.getElementById('backToButton').style.visibility = 'hidden';
  6. }
  7. });
  8. window.addEventListener('scroll', function () {
  9. if (0 < window.scrollY) {
  10. document.getElementById('backToButton').style.visibility = 'visible';
  11. document.getElementById('backToButton').classList.add('view');
  12. } else {
  13. document.getElementById('backToButton').classList.remove('view');
  14. }
  15. });
  16. });