I read code on tutorial example for show and hide ELEMENTS.
Now I wanted change TEXTS and IMAGES with clicking same button and same times.
I tried some codes like this.
export function htu102_onClick(event) {
$w("#text101").hide();
$w("#text102").show();
};
// putted many text elements with hide on load checkbox option.
//#htu102 is the #ID of the button
Hey,
Do you wish to change the label of the button? If so, you can simply change the label of the button . If you wish to change a text element when clicking on the button, you should use the text property of a text element as you already did. If this is not the case, please send us a screenshot of the page so that I can better understand what you were referring.
Hey i think you can do it this way.
Create the things you want to be replaced, put them on the exact same location where the originals are and then set those secondary items texts etc. to hidden on load. After that all you need to do is to hide and show items.
Activate the properties panel under: Tools > Developer Tools > Properties Panel
And assign a click event on your button through this properties panel. It will add the following code to your page:
export function htu102_click(event, $w) {
//Add your code for this event here:
}
add the elements you want to hide or show after a click under this code. Your final code should look like this:
export function htu102_click(event, $w) {
$w("#text101").hide();
$w("#text102").show();
}
Hi,
If you wish to bind elements added to your lightbox with your DB collection, you should add the dataset to the lightbox as well. Note that you can also send information from the page to the lightbox using code (if needed) as explained here .