How to set a button as hovered when hovering over an image?

Hi !

I have put an icon over a button (which is an image), and I’d like the button to remain “hovered” when the image is hovered (as if the image was part of the button).

Is there a way to pull this off? Thanks !

Hi Tristan ,

What you can do is to set a mouseIn/out function for that icon, and assign the same color ( as the button ) on hover. Ex:

export function icon_mouseIn(event) {
    $w("#button").style.backgroundColor = '#ED4545';//assigning same hover color
}

export function icon_mouseOut(event) {
    $w("#button").style.backgroundColor = '#FE6161';//assigning same regular color
}

Hope this helps!
Best,

Mustafa

Thank you ! However it sets the color of every button in the repeater, I’d like only the one hovered to change colors.

@tristan-breon Hi,
Check out the at() function here to get a selector with repeated item scope .