I
I
Igor2015-09-30 11:23:32
css
Igor, 2015-09-30 11:23:32

How to write opening of 1 tab in JS?

welovepavel.esy.es/TBee/index.html

//$(".tab_item").not(":first").hide(); // закрывает вкладки при старте
$(".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");

PsKsIqm.png
on initial loading, the text from the second tab appears in 1 "fffff"
Thank you!
The answer was given by Dear Paul!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Kirill Kublyakov, 2015-09-30
@IgorBee

Set the second taboo to display: none.
PS or try to uncomment the first line of the script you provided (remove the two slashes at the beginning of the line)

D
Dmitry Pyrkin, 2015-09-30
@ps1panda

Add active style to tabs and toggle it as needed. If there is an active class, then we show the tab; if not, then we hide it

G
GoodProject, 2015-09-30
@GoodProject

Do everything as shown in the video tutorial, and there will be no such bugs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question