top of page
Change Layout

Change Layout

Change a layout using a slideshow.

Intermediate.png

Beginner

8K

Published:

January 1, 2020

Girl Enjoying her Drink

by

Anchor 1
Hire a Developer

Example Description

In this example site visitors can change a layout using a slideshow.

Example Code

Tab 1

.

Tab 2

.

Tab 3

.

This code solution can be complicated.

How We Built It

This example demonstrates how to use a slideshow element to design multiple layouts on different slides and change the slides using code.


To use a slideshow for changing layouts, you need to turn off the autoplay feature (in Settings). Then, turn off the navigation arrows and slide buttons (in Layout).


In the top section, we use a slideshow element and a button element to demonstrate the theory behind changing from a list layout to a gallery layout. The slideshow has two slides. One slide contains the elements for the gallery and a button to change the layout to a list layout. The other slide contains the elements for the list and a button to change the layout to a gallery layout. When either button is pressed, the button’s onClick event handler switches the layout.


In the bottom section, we use a slideshow to simulate tabs that are used to switch between layouts. Here, the slideshow element contains the content for both layouts, but not the buttons. That means we need to use the onClick event handlers of the buttons to switch between slides and to enable and disable the buttons that hide and show the different layouts.


Next Steps


  1. Open this example in the Editor to work with the template.

  2. Publish the site.

  3. Learn how to work with examples in Velo.

APIs We Used

Non-code example.

Non-code example.

Related Articles

Article Link

Hire a Developer

Velo solutions are powerful tools, but building them on your own can be challenging. Let an experienced Velo development shop build it for you, so you can keep working on your site or business.

Related Examples

Did this help?

Yes

|

No

Thanks for your feedback!

Hide & Show Elements

Hide & Show Elements

Hide and show elements in response to user interactions.

Intermediate.png

Intermediate

Collapse Elements

Collapse Elements

Collapse and expand groups of elements.

Intermediate.png

Beginner

Hide and Show an Image

Hide and Show an Image

Show and hide an image according to the clicked button.

Intermediate.png

Beginner

Anchor 2
bottom of page