Jul 7, 2020
White Arrow icon
Back to all Elements

Auto Change Tabs 2.0

A new and improved version for a Tabs element that automatically change tabs

The exact same code from Auto Change Tabs is used here (with some annotations):

<script>

var Webflow = Webflow || [];
Webflow.push(function() {

‍   var tabTimeout;
  clearTimeout(tabTimeout);
  tabLoop();


  function tabLoop() {
    tabTimeout = setTimeout(function() {
      var $next = $('.tabs-menu').children('.w--current:first').next();
      if ($next.length) {
        $next.click();
      } else {
        $('.tab-link:first').click();
      }
    }, 3000);
  }

  $('.tab-link').click(function() {
    clearTimeout(tabTimeout);
    tabLoop();
  });
});

</script>

Copy

In this version I added an interaction that created an indicator when the tab is going to change.

Preview:

browser mockup
Share:
Heart icon

Destin's Youtube channel Smarter Every Day is one of my favourite places on the web.

Might also interest you:

3d Video Slider (swiper.js)

Cloneable
CMS
JavaScript

A 3d slider with video items, plays and pauses on click & slide change.

Read more
Blue arrow iconWhite Arrow icon

Webflow Dashboard Workspaces Hack

Webflow UI Hack
Code
CSS

Convert the Workspaces dropdown to an open sidebar with custom order.

Read more
Blue arrow iconWhite Arrow icon

Glossary

Cloneable
JavaScript
CMS

A clonable for creating an Alphabetical glossary

Read more
Blue arrow iconWhite Arrow icon