Buy me a coffee

Click Text Show Quote (v2)

Demo: https://tuanphan-demo01.squarespace.com/click-text-show-quote-v2?noredirect

Password: abc

#1. First, you add a Text Block, with these URLs.

Make sure the option “Open link in new tab” is disabled

  • #quote01
  • #quote02

Click Text Show Quote 01 Min

Click Text Show Quote 02 Min

and 2 Quote Blocks below

Click Text Show Quote 03 Min

#2. Install Squarespace ID Finder and find the ID of all blocks

In my example, we will have:

  • Text Block: #block-yui_3_17_2_1_1711426041349_8517
  • Quote 01: #block-yui_3_17_2_1_1711426041349_5772
  • Quote 02: #block-yui_3_17_2_1_1711426041349_6332

Click Text Show Quote 04 Min

#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(){
   $("#block-yui_3_17_2_1_1711426041349_5772").addClass("show");
  // Quote 01
  $('#block-yui_3_17_2_1_1711426041349_8517 a[href="#quote01"]').click(function(){
    $("#block-yui_3_17_2_1_1711426041349_5772").addClass("show");
$('div:not(#block-yui_3_17_2_1_1711426041349_5772)').removeClass('show');
    }
  );
// Quote 02
 $('#block-yui_3_17_2_1_1711426041349_8517 a[href="#quote02"]').click(function(){
    $("#block-yui_3_17_2_1_1711426041349_6332").addClass("show");
$('div:not(#block-yui_3_17_2_1_1711426041349_6332)').removeClass('show');
    }
  );
 });
</script>
<style>
#block-yui_3_17_2_1_1711426041349_5772, #block-yui_3_17_2_1_1711426041349_6332 {
  opacity: 0;
  transition: all 0.1s ease;
  }
  .show {
  opacity: 1 !important;
     transition: all 0.1s ease;
  }
</style>

Click Text Show Quote 05 Min

#4. Explain code

Click Text Show Quote 06 Min