Demo: https://tuanphan-demo01.squarespace.com/click-text-show-summary-block?noredirect
Password: abc
Suppose you have 2 Texts.
You want: when users hover on each Text > Show Summary Block.
#1. First, you add a Text Block with some text/url.
Make sure the option “Open link in new tab” is disabled
- #summary01
- #summary02
and 2 Summary Blocks below.
#2. Install Squarespace ID Finder to find the ID of the Summary Block.
In my example, we will have:
- Left Summary Block: #block-yui_3_17_2_1_1715307967768_10492
- Right Summary Block: #block-yui_3_17_2_1_1715307967768_11524
#3. Use 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(){ // Summary 01 $("#block-yui_3_17_2_1_1715307967768_10492").closest('.fe-block').addClass('summary01 show'); // Summary 02 $("#block-yui_3_17_2_1_1715307967768_11524").closest('.fe-block').addClass('summary02'); // Summary 01 $('a[href="#summary01"]').click(function(){ $(".summary01").addClass("show"); $('.fe-block:not(.summary01)').removeClass('show'); $(this).addClass('active-link'); $('a:not([href="#summary01"])').removeClass('active-link'); } ); // Summary 02 $('a[href="#summary02"]').click(function(){ $(".summary02").addClass("show"); $('.fe-block:not(.summary02)').removeClass('show'); $(this).addClass('active-link'); $('a:not([href="#summary02"])').removeClass('active-link'); } ); }); </script> <style> .summary01 .summary-v2-block, .summary02 .summary-v2-block { display: none; } .show .summary-v2-block { display: block !important; } .show { z-index: 999999 !important; } .active-link { color: #f1f !important; } </style>
#4. Explain code