I
I
Igor2015-09-29 14:04:25
css
Igor, 2015-09-29 14:04:25

How to make tabs on the page in one line?

welovepavel.esy.es/TBee/index.html I guess the
J9YMMQv.jpg
JS is not quite right.
And at the start of the page, 2 tabs open at once ...
Thank you very much!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Turovnikov, 2015-09-29
@IgorBee

Here is your code:

$(".tabs_header .wrapper .tab").click(function() {
        $(".tabs_header .wrapper .tab").removeClass("active").eq($(this).index()).addClass("active");
        $(".tabs_header .tab_item").hide().eq($(this).index()).fadeIn()
    }).eq(0).addClass("active");

Write a function to initiate when the page loads.
You have jquery connected 2 times, I would not invent a bicycle and connected jquery.ui and used https://jqueryui.com/tabs/
The block with phones is made in a similar way, you can just fix the styles
.tabs_header .tab_item:first-of-type {
    display: block;
}
.tabs_header  .tab_item {
    display: none;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question