like this > (if user click button# show strip# else hide strip #)
This tutorial will get you started on how to accomplish this:
• https://www.wix.com/corvid/example/hide-and-show-an-image
Though instead of hide/show, you will probably be better off using expand / collapse for the strip. If you search for it, there are many many resources for this in the forum!
Best of luck!
Hi
$w('#button').onClick((event) => {
const strip = $w('#strip');
strip.hidden ? strip.show().then(() => strip.scrollTo()) : strip.hide();
})
Hope this helps~!
Hello Ahmad, should your code still be working?
It seems tehere is something missing inside Amad’S provided code…
$w('#button').onClick((event) => {
if ($w('#strip').hidden) {
$w('#strip').show().then(() => {
$w('#strip').scrollTo();
})
} else {
$w('#strip').scrollTo();
}
})
- You click the BUTTON.
- The if-else-query-check runs and checks which is the current state of the button → hidden / non-hidden (true/false)
- The code shows the button if it is hidden…
- But it does not hide the STRIP again, if the button is non-hidden (visible).
$w('#button').onClick((event) => {
if ($w('#strip').hidden) {
$w('#strip').show().then(() => {
$w('#strip').scrollTo();
})
} else {
$w('#strip').hide().then(() => {
//$w('#strip').scrollTo();
})
}
})
@hederik Yes!
@russian-dima Good catch.