Buy me a coffee

Hover Button – Show Spotify

Demo: https://tuanphan-demo01.squarespace.com/hover-button-show-spotify?noredirect

Password: abc

Suppose you have 2 Button Blocks and 2 Spotify Playlists
When hovering over each button, Spotify will appear below it
You can follow these steps:
#1. First, add 2 Button Blocks and 2 Spotify Playlists.

Click Button Show Spotify 03 Min

#2. Edit 2 Button Blocks, and use these URLs:

  • #spotify01
  • #spotify02

and make sure the option “Open Link in New Tab” is disabled.

Click Button Show Spotify 01 Min

Click Button Show Spotify 02 Min

#3. Install Squarespace ID Finder to find the ID of Buttons and Spotify

In my example, we will have:

  • Button Spotify 01: #block-yui_3_17_2_1_1710494580515_16806
  • Button Spotify 02: #block-yui_3_17_2_1_1710494580515_18684

 

  • Spotify 01: #block-yui_3_17_2_1_1710494580515_20757
  • Spotify 02: #block-yui_3_17_2_1_1710494580515_21708

Hover Button Show Spotify 02 Min

#4. 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(){
  // Spotify 01 
  $("#block-yui_3_17_2_1_1710494580515_20757").closest('.fe-block').addClass('spotify01');
  // Spotify 02 
$("#block-yui_3_17_2_1_1710494580515_21708").closest('.fe-block').addClass('spotify02');
  
  // Spotify 01
  $('a[href="#spotify01"]').hover(function(){
    $(".spotify01").addClass("show");
    $('.fe-block:not(.spotify01)').removeClass('show');
    }
  );
// Spotify 02  
 $('a[href="#spotify02"]').hover(function(){
   $(".spotify02").addClass("show");
    $('.fe-block:not(.spotify02)').removeClass('show');
    }
  );
});
</script>
<style>
.spotify01 .code-block, .spotify02 .code-block {
    display: none;
}
  .show .code-block {
      display: block !important;
  }
  .show {
      z-index: 999999 !important;
  }
</style>

Hover Button Show Spotify 05 Min

 

#5. Explain code

Hover Button Show Spotify 06 Min