Jump to content

Help Pleaseeee!! Code Made Text Uneditable!

Go to solution Solved by Beyondspace,

Recommended Posts

Posted (edited)

Site url (copy of actual site that I'm using just for testing): gro-testing-tha.squarespace.com
Password: tha

I have this code to change sitewide animations for one text block so the animation slides right to left instead of up on load (this is for the text block that starts with "Why Bio-Identical Hormone Pellet Therapy?") and it works great, but the text is no longer editable when I go into editing mode (block just appears empty). Any help would be so appreciated! 

Thanks in advance for any help!!🫶🏻

<style>
/* Initial state for block-b4afc95a0259f2af8dec (left to right) */
#block-b4afc95a0259f2af8dec {
  opacity: 0;
  transform: translateX(-100%);
  transition: transform 1s ease, opacity 1s ease;
}

/* Animated state for block-b4afc95a0259f2af8dec */
#block-b4afc95a0259f2af8dec.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Override existing animations */
#block-b4afc95a0259f2af8dec.preSlide,
#block-b4afc95a0259f2af8dec.slideIn {
  animation: none !important;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function() {
  const block = document.getElementById('block-b4afc95a0259f2af8dec');

  if (block) {
    const observer = new IntersectionObserver((entries) => {
      entries.forEach(entry => {
        if (entry.isIntersecting) {
          block.classList.add('visible');
          observer.unobserve(block);  // Stop observing after the animation
        }
      });
    });

    observer.observe(block);
  }
});
</script>

 

Edited by GROCreativeStudio
Clarity
Link to comment
  • Replies 2
  • Views 213
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

  • Solution
13 hours ago, GROCreativeStudio said:

Site url (copy of actual site that I'm using just for testing): gro-testing-tha.squarespace.com
Password: tha

I have this code to change sitewide animations for one text block so the animation slides right to left instead of up on load (this is for the text block that starts with "Why Bio-Identical Hormone Pellet Therapy?") and it works great, but the text is no longer editable when I go into editing mode (block just appears empty). Any help would be so appreciated! 

Thanks in advance for any help!!🫶🏻

<style>
/* Initial state for block-b4afc95a0259f2af8dec (left to right) */
#block-b4afc95a0259f2af8dec {
  opacity: 0;
  transform: translateX(-100%);
  transition: transform 1s ease, opacity 1s ease;
}

/* Animated state for block-b4afc95a0259f2af8dec */
#block-b4afc95a0259f2af8dec.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Override existing animations */
#block-b4afc95a0259f2af8dec.preSlide,
#block-b4afc95a0259f2af8dec.slideIn {
  animation: none !important;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function() {
  const block = document.getElementById('block-b4afc95a0259f2af8dec');

  if (block) {
    const observer = new IntersectionObserver((entries) => {
      entries.forEach(entry => {
        if (entry.isIntersecting) {
          block.classList.add('visible');
          observer.unobserve(block);  // Stop observing after the animation
        }
      });
    });

    observer.observe(block);
  }
});
</script>

 

You can use the following additional selector for CSS to prevent it working on your edit mode

body:not(.sqs-edit-mode) #block...

 

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • 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.