Jump to content

[Share] Click Image - Show List Carousel

Recommended Posts

Description: Click Image >> Show List Carousel under.

If you can't make it work, you can comment below or message me with site url, I can check easier.

#1. Add an Image and insert the URL:

  • #list-carousel

Make sure the option “Open link in New Tab” is disabled

image.png.96f1f4064355fd6cf906dcc231969632.png

And a List Carousel below

image.png.bf9ba6e7277f8e7438eb54bea2be93fc.png

#2. Install Squarespace ID Finder to find the ID of List Carousel (under Image)

https://chromewebstore.google.com/detail/squarespace-id-finder/igjamfnifnkmecjidfbdipieoaeghcff

In my example, we will have:

  • Image: No need to find ID
  • List Carousel: section[data-section-id=”6670e53644d91f34284c07db”]

image.png.3ef39eb1247bb6f3c1d35416503a023d.png

#3. Use this code to Code Injection > Footer (or Page Header Code Injection)

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
$(document).ready(function(){  
  // List Carousel
  $('a[href="#list-carousel"]').click(function(){
    $('section[data-section-id="6670e53644d91f34284c07db"]').addClass("show");
    $('section:not([data-section-id="6670e53644d91f34284c07db"])').removeClass('show');
    }
  );
});
</script>
<style>
section[data-section-id="6670e53644d91f34284c07db"] {
    display: none;
  transition: all 0.5s;
}
  section.show {
      display: block !important;
    transition: all 0.5s;
  }
</style>

image.png.6ca15e9d71448baea9d82ce75bfff0e3.png


#4. Explain code a bit

image.png.f4416deb8484ece9c6cbeccccd6ac6ed.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • Replies 0
  • Views 131
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

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.