Jump to content

TrimbyPhotography

Member
  • Posts

    2
  • Joined

  • Last visited

TrimbyPhotography's Achievements

Level 2

Level 2 (2/20)

0

Reputation

  1. Hi All, I am trying to add Custom CSS to allow content to fade when scrolling down. I am however given a 'Syntax Error on Line 1' (and others) message. Please can you advise what should be changed? Code as follows: <style> .fade-out { opacity: 1; transition: opacity 0.5s ease-out; } .fade-out-scroll { opacity: 0; } </style> <script> document.addEventListener('DOMContentLoaded', function() { var sections = document.querySelectorAll('.sqs-block'); var observer = new IntersectionObserver(function(entries) { entries.forEach(function(entry) { if (entry.intersectionRatio <= 0) { entry.target.classList.add('fade-out-scroll'); } else { entry.target.classList.remove('fade-out-scroll'); } }); }); sections.forEach(function(section) { observer.observe(section); }); }); </script> Thanks for your help
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.