How do I hide and show or toggle between a picture (cover pic) and gallery. E.g I have a picture and when I click ‘show gallery’ the pic transform into a gallery and when i click ‘hide gallery’ the gallery transforn back into the pic?
Hi, Amari! You can add some code for page with image, gallery, button added e.g. and you will be able to switch image and gallery
$w.onReady( function () {
$w(“#gallery1”).hide();
});
export function button1_click(event, $w) {
if ($w(“#image1”).isVisible){
$w(“#gallery1”).show();
$w(“#image1”).hide();
$w(“#button1”).label = “Back into the pic”;
}
else {
$w(“#image1”).show();
$w(“#gallery1”).hide();
$w(“#button1”).label = “Show Gallery”;
}
}
In addition maybe it is better to use Dynamic pages approach CMS: Examples of Dynamic Pages | Help Center | Wix.com and https://support.wix.com/en/article/how-to-add-a-dynamic-category-page