You can send your questions to my email to get faster answer in 24 hours (free).
Buy me a coffee

Hover text – Show image on right

Demo: https://tuanphan-demo01.squarespace.com/hover-text-show-image-on-right?noredirect
Pass: abc

Suppose you have 5 texts: Apple, Microsoft, Facebook, Instagram, and Google.

You want: when users hover on each text > show an image on the right side, something like this.

hover-text-show-more-text-on-right-01-min

#1. First, add a Text Block with 5 Paragraph, then add these URLs

  • Apple – #apple
  • Microsoft – #microsoft
  • Facebook – #facebook
  • Instagram – #instagram
  • Google – #google

and make sure “Open Link in new tab” is DISABLED.

hover-text-show-more-text-on-right-02-min

hover-text-show-more-text-on-right-03-min

hover-text-show-image-on-right-06

hover-text-show-image-on-right-07

hover-text-show-more-text-on-right-06-min

#2. Add 5 Image Blocks on the right side (You can drag them to make them overlap together then, or keep the current position if you want).

hover-text-show-more-text-on-right-07-min

#3. Install Squarespace ID Finder tool (Free)

hover-text-show-more-text-on-right-08-min

Then, you can find the ID of 5 Image Blocks and Text Block with the tool. In this example, we will have

  • Section ID: section[data-section-id=”65ddb0e3774fbc5683717e39″]
  • Text Block: #block-yui_3_17_2_1_1709027479615_23578
  • Apple Image: #block-yui_3_17_2_1_1709027479615_25260
  • Microsoft: #block-yui_3_17_2_1_1709027479615_25837
  • Facebook: #block-yui_3_17_2_1_1709027479615_26404
  • Instagram: #block-yui_3_17_2_1_1709027479615_26980
  • Google: #block-yui_3_17_2_1_1709027479615_27455

hover-text-show-more-text-on-right-09-min

#4. 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(){
  // Apple
  $("#block-yui_3_17_2_1_1709027479615_25260").closest('.fe-block').addClass('apple show');
  $('a[href="#apple"]').addClass('active-link');
  // Microsoft
$("#block-yui_3_17_2_1_1709027479615_25837").closest('.fe-block').addClass('microsoft');
  // Facebook
$("#block-yui_3_17_2_1_1709027479615_26404").closest('.fe-block').addClass('facebook');
  // Instagram
$("#block-yui_3_17_2_1_1709027479615_26980").closest('.fe-block').addClass('instagram');
  // Google
$("#block-yui_3_17_2_1_1709027479615_27455").closest('.fe-block').addClass('google');
  
  // Apple
  $('a[href="#apple"]').hover(function(){
    $(".apple").addClass("show");
    $('.fe-block:not(.apple)').removeClass('show');
    $(this).addClass('active-link');
    $('a:not([href="#apple"])').removeClass('active-link');
    }
  );
// Microsoft
 $('a[href="#microsoft"]').hover(function(){
   $(".microsoft").addClass("show");
    $('.fe-block:not(.microsoft)').removeClass('show');
   $(this).addClass('active-link');
    $('a:not([href="#microsoft"])').removeClass('active-link');
    }
  );
// Facebook
 $('a[href="#facebook"]').hover(function(){
   $(".facebook").addClass("show");
    $('.fe-block:not(.facebook)').removeClass('show');
   $(this).addClass('active-link');
    $('a:not([href="#facebook"])').removeClass('active-link');
    }
  );
// Instagram
 $('a[href="#instagram"]').hover(function(){
   $(".instagram").addClass("show");
    $('.fe-block:not(.instagram)').removeClass('show');
   $(this).addClass('active-link');
    $('a:not([href="#instagram"])').removeClass('active-link');
    }
  );
// Google
 $('a[href="#google"]').hover(function(){
   $(".google").addClass("show");
    $('.fe-block:not(.google)').removeClass('show');
   $(this).addClass('active-link');
    $('a:not([href="#google"])').removeClass('active-link');
    }
  );
});
</script>
<style>
.apple .image-block, .microsoft .image-block, .facebook .image-block, .instagram .image-block, .google .image-block {
    display: none;
}
  .show .image-block {
      display: block !important;   }
  .show {
      z-index: 999999 !important;
  }
  .active-link * {
  color: #f1f !important;
  }
</style>

hover-text-show-more-text-on-right-13-min

#5. Explain

hover-text-show-more-text-on-right-14-min

hover-text-show-more-text-on-right-15-min

Ask me a question, free

If your site is private or in trial, just setup password and share url. See how to: https://beaverhero.com/squarespace-how-to/
Please check your email carefully. Recently I got a lot of questions with wrong emails.

If you haven't heard from me within 24 hours please check your junk/spam folder