The result is suppose to be when I click on the button it disappears revealing the text underneath.
If anyone has a better idea please let me know.
I’ve got it to work with just one button but I’m trying to find a more elegant solution to impact all the buttons instead of copy and pasting and changing the button it targets 20 times.
Any ideas why this isn’t working would be much appreciated!
Please see some references I looked at but couldn’t get working following:
Didn’t seem to work and I understand the logic of where you’re trying to go with this. But didn’t work. I tried copying and pasting exactly what you have and no luck. I’ve also tried changing to this
@jonatandor35 I’ve done some more tests even copied and pasted what you provided in your example and when I try to preview the site it gives me this error.
Ok figured out an issue not sure if a bug or not but when I use $w(“Button”) it isn’t able to reference the buttons to be used which leads to nothing happening in a loop and why I’m getting the onClick is not a function.
Once that has been changed to:
[$w(“#button1”).onClick( (event) => {$w(“#” + event.target.id).hide(“fade”, fadeOptions)});]($w(“#button1”).onClick( (event) => {$w(“#” + event.target.id).hide(“fade”, fadeOptions)})
It works, can someone check if this is a bug?
I made another new page and got it to work how weird it doesn’t work on the other page…
@jonatandor35 Thanks for the info here. Works great.
I was wondering if it’s possible to use this method but also show the button that has been hidden if another button is pressed? i.e. one button is hidden but when you click another button is hides that button that has been clicked but shows the previously hidden button, so only one hidden button at a time.