how to make text to change color waen hoverd

how to mack the txet color changing with wix coce waen mause is hovord in on text
like if the text is black it shuld become white with a black backrund
tnx

Hi,
Check out this reference:

Roi.

Hi Avrumi,

You can achieve that using a button and mouseIn & mouseOut events.
See the code sample below

export function button1_mouseIn(event, $w) {
    $w('#button1').style.color = "black"
    $w('#button1').style.backgroundColor = "white"
}

export function button1_mouseOut(event, $w) {
    $w('#button1').style.color = "white"
    $w('#button1').style.backgroundColor = "black"
}

Hi Ido,

I have the same question, and following your suggestion I have come up with the following code, but it does not work for my element #text17. One error message I get

  1. Parameter never used in relation to ‘event’ (for the first line of code)
  2. ‘Style’ undefined (for the second line of code)

export function text17_mouseIn(event, $w) {
$w(‘#text17’).style.color = “black”
}

export function text17_mouseOut(event, $w) {
$w(‘#text17’).font.color = “white”

}

Hi Ido,

I have thought about your advice, and adopted it using buttons. The hover effect can actually be set by ‘right clicking’ when on the button and selecting ‘Design’, cusatomising ‘Standard’, ‘Mouseover’ and ‘Deactivated’, without having to do any coding.

Hope I haven’t misunderstood what wanted to be achieved by your coding.

Kind Regards

Christian

but on text its not working the code is saying style undefind ???

Just create a button without borders & an empty background. It will be exactly like a text element.