@rodney If you could help me, that would be awesome! Basically, what I’m trying to do with my code is make a little menu that, when you hover on a menu item (“#workMenu” + index), it changes from navy (#0F1227) to teal (#3C958B) and changes back on mouseOut. Then I would like to code it so that when you click on a menu option, it changes to orange (#FCB449) and stays there even on mouseOut until I click another menu option, at which point it turns navy again. I know how to set up a similar condition in a function if I were to use something like a hide/show function where if one thing is showing, it automatically hides everything else until I choose to show something else, but since I can’t figure out the “if” statement for changing text color, I can’t figure this out. I tried a variety of options, none of which worked, so I stripped it down to the basics of what I have so far. Let me know if you think of anything. Also, here is the link to the page if you want to see it:
https://www.marisaypurdy.com/menu-effects-test-page
$w.onReady( function () {
});
function workHover(index){
$w(“#workMenu”+index).html = <h5 style = "color:#3C958B"> ${$w("#workMenu"+index).text} </h5>
;
}
function workUnHover(index){
$w(“#workMenu”+index).html = <h5 style = "color:#0F1227"> ${$w("#workMenu"+index).text} </h5>
;
}
function workOnClick(index){
$w(“#workMenu”+index).html = <h5 style = "color:#FCB449"> ${$w("#workMenu"+index).text} </h5>
;
}
//------------EXPORT FUNCTIONS: HOVER------------
//-----Work Menu 1 “Branding”-----
export function workMenu1_mouseIn(event) {
workHover(1);
}
export function workMenu1_mouseOut(event) {
workUnHover(1);
}
//-----Work Menu 2 “Typography”-----
export function workMenu2_mouseIn(event) {
workHover(2);
}
export function workMenu2_mouseOut(event) {
workUnHover(2);
}
//-----Work Menu 3 “Illustration”-----
export function workMenu3_mouseIn(event) {
workHover(3);
}
export function workMenu3_mouseOut(event) {
workUnHover(3);
}
//-----Work Menu 4 “Photography”-----
export function workMenu4_mouseIn(event) {
workHover(4);
}
export function workMenu4_mouseOut(event) {
workUnHover(4);
}
//-----Work Menu 5 “All”-----
export function workMenu5_mouseIn(event) {
workHover(5);
}
export function workMenu5_mouseOut(event) {
workUnHover(5);
}
//------------EXPORT FUNCTIONS: CLICK------------
//-----Work Menu 1 “Branding”-----
export function workMenu1_click(event) {
workOnClick(1);
}
//-----Work Menu 2 “Typography”-----
export function workMenu2_click(event) {
workOnClick(2);
}
//-----Work Menu 3 “Illustration”-----
export function workMenu3_click(event) {
workOnClick(3);
}
//-----Work Menu 4 “Photography”-----
export function workMenu4_click(event) {
workOnClick(5);
}
//-----Work Menu 5 “All”-----
export function workMenu5_click(event) {
workOnClick(5);
}