Jump to content

Change navigation text on hover

Recommended Posts

  • Replies 7
  • Views 2k
  • Created
  • Last Reply

Top Posters In This Topic

On 1/25/2021 at 7:17 PM, LizzyJo said:

@tuanphan it is the "follow" text that I want to change to "@itsnicetohearyou" on hover.  As well as "get in touch" to be the email address on hover. Thank you so much!

Add to Design > Custom CSS

/* Chage text on hover */
a.Header-nav-item[href*="instagram.com"]:hover {
    visibility: hidden;
}
a.Header-nav-item[href*="instagram.com"]:hover:after {
    visibility: visible;
    content: "@instagram-text";
}
a.Header-nav-item[href*="mailto"]:hover {
    visibility: hidden;
}
a.Header-nav-item[href*="mailto"]:hover:after {
    visibility: visible;
    content: "tuanphan@squarespace.com";
}

 

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
  • 2 years later...

Hi @tuanphan

I am trying to replace my Navigation link of "Research & Development" with "Coming Soon" on hover, but the "Coming Soon" is just appearing next to the navigation link rather than replacing it, any ideas?

/* Change text on hover */


.header-nav-item a[href*="/research-and-development"]::after {
    content: "Coming Soon" !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease-in-out !important;
    pointer-events: none;
}
.header-nav-item a[href*="/research-and-development"]:hover::after {
    opacity: 1 !important;
}

 

https://www.ud-hub.com/

Link to comment
On 3/10/2023 at 9:48 PM, Offdaze said:

Hi @tuanphan

I am trying to replace my Navigation link of "Research & Development" with "Coming Soon" on hover, but the "Coming Soon" is just appearing next to the navigation link rather than replacing it, any ideas?

/* Change text on hover */


.header-nav-item a[href*="/research-and-development"]::after {
    content: "Coming Soon" !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease-in-out !important;
    pointer-events: none;
}
.header-nav-item a[href*="/research-and-development"]:hover::after {
    opacity: 1 !important;
}

 

https://www.ud-hub.com/

Add this to Settings > Advanced > Code Injection > Footer

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
$('div.header-nav-item a[href="/research-and-development"]').hover(function(){
    $(this).text("Coming Soon");
});
</script>

 

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
  • 6 months later...
On 3/12/2023 at 1:36 AM, tuanphan said:

Add this to Settings > Advanced > Code Injection > Footer

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
$('div.header-nav-item a[href="/research-and-development"]').hover(function(){
    $(this).text("Coming Soon");
});
</script>

 

Hi @tuanphan! This works great to change the text on hover, but it isn't changing back when I remove my cursor. I'd like it to change text when I hover and then return to normal when I remove it. What's the best way to make that happen? Also, is there a way to have the text change when the page is active? 

Here's a breakdown of what I'd like to do:

Normal: WHO

Upon hover: Who We Are

Upon removing: WHO

After clicking and actively on the page: Who We Are

Thanks!

Link to comment
On 9/15/2023 at 3:29 AM, shannonandanjna said:

Hi @tuanphan! This works great to change the text on hover, but it isn't changing back when I remove my cursor. I'd like it to change text when I hover and then return to normal when I remove it. What's the best way to make that happen? Also, is there a way to have the text change when the page is active? 

Here's a breakdown of what I'd like to do:

Normal: WHO

Upon hover: Who We Are

Upon removing: WHO

After clicking and actively on the page: Who We Are

Thanks!

Use this, if it doesn't work, please share site url, we can check easier

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
$('div.header-nav-item a[href="/research-and-development"]').hover(function(){
    $(this).text("Coming Soon");
}, function(){
    $(this).text("WHO");
  });
</script>

 

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

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.