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:

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

Websites designed by WixCreate that use the above Wix Code:

Official Wix Expert & Wix Agency Partner

© 2020 by WIXCreate.com

I  All Rights Reserved  I  info@wixcreate.com  I  202-640-5440

facebook-2.gif