Changing colour hover not working.

I am currently working on a website (for the first time using wix) and I have come across a problem. I am trying to create roll over text links so the text slightly changes colour when the mouse rolls over.

This bit I have got working fine with no issues using code. However I am a little confused to why the link disappears, the text does not hyperlink once it is working with the roll over, I know this is a very simple problem and I must be doing something wrong someplace, I just can not figure out what it going wrong.

I would really love any help with this!

Hey Michael,

Welcome to the wonderful world of Wix Code.

Tell use a little bit more about what you’re trying to do. What code do you have? How are the components configured?

If you continue to have problems, please post the URL of your site. Only authorized Wix personnel can get access to your site in the editor.

Yisrael

Hey man thanks for the reply, it is a really stright forward thing I am trying to do. I shall use images to help explain.


So in this above gif you can see when my mouse is hovering over the top link to make it easy for the end user to be able to select, thats nice. I have used the following code for this effect.

$w.onReady( function () {
$w(‘#text48’).onMouseIn(()=>{hoverTxt();});
$w(‘#text48’).onMouseOut(()=>{unhoverText();});
});

function hoverTxt(){
let oldHtmlStr = $w(‘#text48’).html;
$w(‘#text48’).html = “

Computational Thinking & Programming Logic

”;
}

function unhoverText(){
let oldHtmlStr = $w(‘#text48’).html;
$w(‘#text48’).html = “

Computational Thinking & Programming Logic

”;

}

My questions is a simple one really, I am just maybe having one of those days, where in here do you put the tag for the link, when I add it the link just does not seem to work. Whenever I link it just selects the writing, its link the hyperlink is not present anymore.

Thanks for getting back to me so quickly,

Hmm, perhaps you could just add the tag for the link right inside the

tag. However, it seems to me that you are trying to do too much with HTML instead of using “native” Wix Code. Wix Code is designed to make things easy for the developer. Instead of dealing with complicated HTML code, you can just configure the appropriate Wix Code components to do the “dirty” work for you.

I would suggest using either a Repeater or a Table which would do a lot of the work for you.

Good luck,

Yisrael