Jump to content

[Share] Hover Text - Show Logo

Recommended Posts

Posted

If you can't make it work, you can send site url + exact code you added to your site, I can check easier.

Description: Hover text, replace it with a logo

Suppose you have 5 client texts: Apple, Microsoft, Facebook, Instagram, and Google. You want: when users hover on each client text > show a logo over + hide text, something like this.

image.png.c1eeeb27e8d07d7058610bb3d57e6ce0.png

#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 the option “Open Link in new tab” is DISABLED.

If you need to remove underline under text, you can comment below, I will give the code

image.png.51ee2f0daffe0c753eb7ce86a4ccedad.png image.png.4ae1da04f1a77bd9fae103da92c266e0.png

image.png.d56f1fdebb2cd34b942439c580a38942.png

#2. Add 5 Image Blocks over the Text Block (You can drag them to make a nice position). In my example, I added these.

image.thumb.png.73739dad155a283b3b50affce5ddf692.png

#3. Find ID of 5 Image Blocks

In my example, we will have:

  • Text Block: #block-yui_3_17_2_1_1709302191320_24592
  • Apple: #block-yui_3_17_2_1_1709302191320_26267
  • Microsoft: #block-yui_3_17_2_1_1709302191320_26851
  • Facebook: #block-yui_3_17_2_1_1709302191320_27989
  • Instagram: #block-yui_3_17_2_1_1709302191320_27419
  • Google: #block-yui_3_17_2_1_1709302191320_28558

image.png.53ad1654c3ce8c7740d60baa9cc99850.png

#4. Use this code to Code Injection Footer (or Page Header 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_1709302191320_24592 a[href="#apple"]').hover(function(){
    $("#block-yui_3_17_2_1_1709302191320_26267").addClass("show");
$(this).css('opacity','0');
    }, function(){
    $('#block-yui_3_17_2_1_1709302191320_26267').removeClass("show");
$(this).css('opacity','1');
    }
  );
// Microsoft
 $('#block-yui_3_17_2_1_1709302191320_24592 a[href="#microsoft"]').hover(function(){
    $("#block-yui_3_17_2_1_1709302191320_26851").addClass("show");
$(this).css('opacity','0');
    }, function(){
    $('#block-yui_3_17_2_1_1709302191320_26851').removeClass("show");
$(this).css('opacity','1');
    }
  );
  // Facebook 
   $('#block-yui_3_17_2_1_1709302191320_24592 a[href="#facebook"]').hover(function(){
    $("#block-yui_3_17_2_1_1709302191320_27989").addClass("show");
$(this).css('opacity','0');
    }, function(){
    $('#block-yui_3_17_2_1_1709302191320_27989').removeClass("show");
$(this).css('opacity','1');
    }
  );
// Instagram
  $('#block-yui_3_17_2_1_1709302191320_24592 a[href="#instagram"]').hover(function(){
    $("#block-yui_3_17_2_1_1709302191320_27419").addClass("show");
$(this).css('opacity','0');
    }, function(){
    $('#block-yui_3_17_2_1_1709302191320_27419').removeClass("show");
$(this).css('opacity','1');
    }
  );
 // Google
  $('#block-yui_3_17_2_1_1709302191320_24592 a[href="#google"]').hover(function(){
    $("#block-yui_3_17_2_1_1709302191320_28558").addClass("show");
$(this).css('opacity','0');
    }, function(){
    $('#block-yui_3_17_2_1_1709302191320_28558').removeClass("show");
$(this).css('opacity','1');
    }
  );
});
</script>
<style>
#block-yui_3_17_2_1_1709302191320_28558, #block-yui_3_17_2_1_1709302191320_27419, #block-yui_3_17_2_1_1709302191320_27989, #block-yui_3_17_2_1_1709302191320_26851, #block-yui_3_17_2_1_1709302191320_26267 {
  opacity: 0;
  transition: all 0.1s ease;
  }
  .show {
  opacity: 1 !important;
     transition: all 0.1s ease;
  }
</style>

image.png.afdca70a15540cbb98b51b396459bef3.png

#5. Explain a bit

image.png.98344ccfd2394e67e3e990d924578ebb.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!)

  • Replies 0
  • Views 644
  • 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.