top of page
Hiding Content When There is No Content
Code is below
$w.onReady(() => {
$w("#dynamicDataset").onReady(() => {
// Gets the current item properties and stores them in a variable called item
const item = $w("#dynamicDataset").getCurrentItem();
// Checks if the current item has a value in the "video" field
if (!item.video) {
// Collapses the video player if there is no value for "video"
$w("#videoBox1").collapse();
}
if (!item.photo) {
// Collapses the image if there is no value for "photo"
$w("#imageX2").collapse();
}
if (!item.document) {
// Collapses the button if there is no value for "document"
$w("#button3").collapse();
}
if (!item.email) {
// Collapses the text field if there is no value for "email"
$w("#text18").collapse();
}
if (item.boolean) {
// Collapses the section if there IS a value for "Hide Section"
$w("#section14").collapse();
}
});
}); $w.onReady(() => {
As seen on:
A global community of cross-disciplinary designers, from web and UI/ UX to product design
A community for professional web designers and agency founders who want to double their business without doubling their efforts
See More Videos
bottom of page