Add

Lorem ipsum

Lorem ipsum

A
A
A
Design

1 views

6 min

Automatic tab switching every X seconds in Webflow

Introduction

CSS ClassWebflow ElementRole
tabs-menuTab MenuTab container (1st component)
tab-buttonTab LinkEach tab button (1st component)
tabs-menu-2Tab MenuTab container (2nd component)
tab-button-2Tab LinkEach tab button (2nd component)

Automatically switching tabs every X seconds can serve a few different purposes.

Here are a few reasons you might do it:

  1. User Engagement: Motion or periodic changes can grab users' attention and encourage them to interact more with each tab's content.
  2. Content Highlighting: If you have multiple offers or pieces of information you want to showcase, automatic tab switching can make sure each one gets equal attention from visitors.
  3. Limited Space: If you have limited space on your website to display information, using tabs with automatic switching can be an effective way to show more content in a small area.

good to know

Before we begin, if you'd like to learn more about Gemeos Agency, feel free to book a meeting by clicking here.

Here's how to do it:

Add a tabs element

You can add as many tabs as you want

automatic tab switching Webflow

Add the “tab-button” class to each of your tab links

automatic tab switching Webflow

Add the “tabs-menu” class to your tab menu

automatic tab switching Webflow

Add this custom code to your page before the <body> tag

If you have just one tab element

If you're using multiple tabs elements on your page

Make sure you use:

  • .tabs-menu-2
  • .tab-button-2

for the classes on your second tabs element

 

good to know

Good to know: If you want to add more than two, just duplicate the following code in the previous code and use .tabs-menu-3… and so on.

 

Change the rotation duration

All you need to do is change the delay (in milliseconds) in the code here:

 

good to know

If you want to manage more than two tabs elements, duplicate the tabLoop block and increment the classes (.tabs-menu-3, .tab-button-3…). For a no-jQuery solution, native Webflow interactions or Swiper can replace this script depending on the use case.

Publish and test the result

Good to know

Heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Lorem ipsum dolor sit amet consectetur.

Lorem ipsum dolor sit amet consectetur. Aliquam orci sagittis dignissim sapien praesent donec.

Lorem ipsum

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Published on 10.04.2025

You might be interested in these tutorials

Similar tutorials

SEO / GEO

5 min read

5 views

How to Set Up a Redirect in Webflow? (2026)

Updated on 19.12.2025 by Sandro DA SILVA

SEO / GEO

5 min read

5 views

Add structured data to your Webflow site?

Updated on 21.08.2025 by Sandro DA SILVA

No-code

5 min read

5 views

How to Obfuscate a Link in Webflow

Updated on 23.04.2025 by Sandro DA SILVA

Let’s f*****G GO !!

Ready to launch
Your business?

Alexandre

Max

Enora

Bryan

Cannelle

Tiphaine

You'll :heart: our collaboration...