Jump to content

[Share] Hover text - Show Summary Block

Recommended Posts

Description: Hover on each text will show corresponding Summary Block.

If you can't make code work, you can send link to page where you use Summary Block, I will check again.

#1. First, you add a Text Block with some text/url.

  • #summary01
  • #summary02

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

image.png.738df3ce1918eca7efb1858d2558ae44.png

image.png.30584aec3def756ddf233c13768a4836.png

and add 2 Summary Blocks under.

image.png.4b3c918eb73138cb7ca91f1bbb1a3f5c.png

#2. Find ID of Summary Blocks, Text Block. Use below tool.

In my example, it is

  • Left Summary Block: #block-yui_3_17_2_1_1715250113016_8728
  • Right Summary Block: #block-yui_3_17_2_1_1715250113016_10233

image.png.0b2ea9ed5edb2b1b6309c62657fff9fb.png

#3. Use this code to Code Injection > Footer (or Individual Page Header Injection, page where you use Summary Block)

<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_1715250113016_8728").closest('.fe-block').addClass('summary01 show');
  // Summary 02
$("#block-yui_3_17_2_1_1715250113016_10233").closest('.fe-block').addClass('summary02');
  
  // Summary 01
  $('a[href="#summary01"]').hover(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"]').hover(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>

image.png.757c207e49d3e7450bd0966ba5a35853.png

#4. Explain code

image.png.8dccbc10207fd2ef6896d3d8df5a85ab.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 703
  • 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.