Can anyone help a bro out with a code that hides and shows an image by utilizing a toggle switch? Any help would be appreciated, God Bless!
top of page
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
bottom of page
Hi @James Kazualkazh Owens ,
Here is an easy solution:
$w.onReady(function () { $w("#switch1").onClick(() => { if ($w("#switch1").checked) { $w("#image9").show() } else { $w("#image9").hide() } }) });
For such examples you can use the forum or articles search - it may bring examples that you need to adjust or simply to use as is.
For example: https://www.wix.com/corvid/forum/community-discussion/hide-or-show-element
Thanks.
Hi Everyone,
Not sure if anyone else is having the same technical issue but can't create my own post for some reason so seeing the expertise here think its the right place...!
Would be really grateful of some help with this.
Currently I have a vector image set to unmute a background video on the page below bottom right with the label #Sound
https://www.beyonddesignagency. com/dance-with-me-short-film
It is successfully unmuting an autoplay video in the background for both desktop (videoBox2) and tablet / mobile (videoBox1).
The code is below:
export function Sound_click(event) { $w("#videoBox2").unmute(); $w("#videoBox1").unmute();
}
What I would ideally like to do is make this a toggle on / off - mute / unmute button but I can't seem to find the code for this?
I don't want to have two separate buttons for this, which could be achieved using the reverse of the code above and ideally another image would swap in to indicate the off state when its initiated.
Any pointers?
Many thanks!
How do you toggle out & in an entire row in a WIX database?