Hi,
I’m trying to implement a Text that changes color after clicking a button.
Here is my implementation using Wix Code:
export function button2_onClick(event) {
targetText.html = ‘
’+targetText.text+‘
’;
}
Using Text:
The problem is that I can’t choose the Text rotation degree using the editor interface.
Using Button:
I can freely rotate the object and I can change its text, but I can’t access it’s color / font attributes.
Any suggestions?
So you don’t just want to change color, you want to rotate the button as well?
To keep it simple: I want to change the color and font of a button, in onClick() event of a different button.
currently we do not support changing styles at runtime.
it is in our backlog…
anyway there’s a simple workaround, see it it’s suitable in your case.
simply add another button with the style you want and make it hidden.
when you need to trigger the change, simply hide the original one and show the new one.
let me know how it worked!
Hi All,
Was trying to customize my buttons and found this useful resource .
Good luck!
Regards,
Ben
hi, i want to just rotate image. can visitor rotate image with help a button?