I have the following code
export function button19_click(event) {
$w('#columnStrip15').expand()
$w('#box3').expand()
}
When the button is clicked for the second time I want it to close the box and the strip. How do I do this?
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.
let isVisible = false; export function button17_click(event){ if(isVisible) { $w('#columnStrip15').collapse() $w('#box3').collapse() isVisible = false }else { $w('#columnStrip15').expand() $w('#box3').expand() isVisible = true } }
You can also try this -
let isVisible = false; export function button17_click(event){ if(isVisible) { // Collapse the items you want isVisible = false }else { // Expand the items you want isVisible = true } }
on line 15 I am getting a error - 'isVisible' is a member but used as function. Can you advise?
Try this:
exportfunction button19_click(event) { if ($w('#columnStrip15').isVisible || $w('#box3').isVisible()) { $w('#columnStrip15').collapse() $w('#box3').collapse() }else{ $w('#columnStrip15').expand() $w('#box3').expand() }