tuanphan Posted September 20 Posted September 20 Description: Hover text (on left) - Show more text (on right) Demo: https://tuanphan-demo01.squarespace.com/hover-text-show-more-text?noredirect Pass: abc If the code doesn't work on your site, you can send site url + which exact code you added, I can check easier. Suppose you have 5 texts: Apple, Microsoft, Facebook, Instagram, and Google. You want: when users hover on each text > show more text on the right side, something like this. #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 #2. Add 5 Text Blocks on the right side (You can drag them to make them overlap together then, or keep the current position if you want). #3. Find ID of Text Block (Left) and 5 Text Blocks (Right) In my example, we will have: Apple: #block-yui_3_17_2_1_1709172012907_25285 Microsoft: #block-yui_3_17_2_1_1709172012907_26049 Facebook: #block-yui_3_17_2_1_1709172012907_27013 Instagram: #block-yui_3_17_2_1_1709172012907_28082 Google: div#block-yui_3_17_2_1_1709172012907_29250 #4. Use this code to Individual Page Header Injection (page where you added 6 Text Blocks) <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_1709172012907_25285").closest('.fe-block').addClass('apple show'); $('a[href="#apple"]').addClass('active-link'); // Microsoft $("#block-yui_3_17_2_1_1709172012907_26049").closest('.fe-block').addClass('microsoft'); // Facebook $("#block-yui_3_17_2_1_1709172012907_27013").closest('.fe-block').addClass('facebook'); // Instagram $("#block-yui_3_17_2_1_1709172012907_28082").closest('.fe-block').addClass('instagram'); // Google $("div#block-yui_3_17_2_1_1709172012907_29250").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 .html-block, .microsoft .html-block, .facebook .html-block, .instagram .html-block, .google .html-block { display: none; } .show .html-block { display: block !important; } .show { z-index: 999999 !important; } .active-link, .active-link * { color: #f1f !important; } </style> #5. Explain a bit 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!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment