This is a gentle fork from https://framagit.org/marienfressinaud/photos.marienfressinaud.fr with a responsive and optimized mindset. https://media.larlet.fr/
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.

retour-en-haut.js 539B

1234567891011121314
  1. (function () {
  2. var backToTopContainer = document.querySelector('#la-haut');
  3. var intersectionObserver = new IntersectionObserver(function (entries) {
  4. entries.forEach(function (entry) {
  5. entry.target.classList.toggle('entrecoupant', entry.isIntersecting);
  6. });
  7. });
  8. intersectionObserver.observe(backToTopContainer);
  9. var backToTopButton = backToTopContainer.querySelector('button');
  10. backToTopButton.onclick = function() {
  11. window.scrollTo({ top: 0, behavior: 'smooth' });
  12. };
  13. }());