K
K
kentos2018-08-22 15:59:42
JavaScript
kentos, 2018-08-22 15:59:42

How to make tabs auto-play?

How to make the tabs change themselves? Can't be changed in
settings

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lloydbanks, 2018-08-22
@kentos

(function($) {
    function tabsAutoPlay() {
        var wrapper = $('.w-tabs-list-h').filter(':visible'),
            el = wrapper.find('.w-tabs-item'),
            nextEl = (el.filter('.active').next().length) ?
                 el.filter('.active').next() :
                 el.filter(':first-child');
        nextEl.click();
    }

    setInterval(tabsAutoPlay, 2000);

})(jQuery);

2000ms = 2 sec. Replace with your span if necessary

D
Denis Bogdanov, 2018-08-22
@funcbook

set a timer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question