top of page
Anchor 1

Wix Tutorial - Change Site Content in Response to a User Interaction, using Wix Code

This example shows how to use events as users interact with your site and change your site content accordingly.

An event handler is used to change between the tabs. 

Elements:

Elements:

  • Button Description: #button1    |   Add onClick event in the Properties Panel

  • Button Gallery: #button2    |   Add onClick event in the Properties Panel

  • Box for Description: #description

  • Box for Gallery: #gallery

Wix Code:

export function button1_click(event) {
    $w("#description").show();
    $w("#gallery").hide();
}

export function button2_click(event) {
    $w("#description").hide();
    $w("#gallery").show(); 
}

Demo:

Description

This is a description of the property, the number of bedrooms, bathrooms, and how many people the property can accommodate.

Photo Gallery
Wix Code Change Content
bottom of page