Hi there!
I’m happy to be figuring out Wix Code a little. I hope it provides much of what I want to add to my site in terms of customization.
So! I’m trying to create a mouseover hover event with a text box, I’m not using a button with hover option because I cannot create a line break in the text with a button, and I want the text element to be on two lines. It is visible here: https://www.vanislandsfinest.ca/home, in the header, “BEST BUDS Referrals Program”.
The following is the code as I have determined it, mostly researching, using copy and paste:
export function text91_mouseIn(event, $w) {
$w.onReady( function () {
$w.onReady( function () {
$w(‘#text91’).onMouseIn(() => { hoverTxt(); });
$w(‘#text91’).onMouseOut(() => { unhoverText(); });
});
function hoverTxt() {
let oldHtmlStr = $w(‘#text91’).html;
let newHtmlStr = $w(‘#text91’).html = “
BEST BUDS
Referrals Program
console.log(newHtmlStr);
$w(‘#text91’).html = newHtmlStr;
}
function unhoverText() {
let oldHtmlStr = $w(‘#text91’).html;
let newHtmlStr = oldHtmlStr.replace(‘/#000000/I’, ‘#50AB48’);
console.log(newHtmlStr);
$w(‘#text91’).html = newHtmlStr;
}
SO, I’m not a programmer but sort of understand the above, though when I try to input this code, it returns a red parsing error at the very end. I researched further, and found that I’m not closing the brackets properly. However I am not sure of how to proceed to check or test, or which bracket or where it is that I need to close it!
If it is possible for you to help, it will be much appreciated. The answer as well as a little explanation of how to proceed next time it occurs.
Thank you kindly,
Brenden