Hello! I have already described my problem on this site, but have not received a response. I came across a post with a similar problem , but I did not fully understand its solutions. Actually, here's the thing: There is such a tab from bootstrap:

<ul id="myTab" class="nav nav-tabs"> <li class="active"><a href="#home" data-toggle="tab">Первая вкладка</a></li> <li><a href="#profile" data-toggle="tab">Вторая вкладка</a></li> </ul> <div id="myTabContent" class="tab-content"> <div class="tab-pane fade in active" id="home"> <p>Содержание первого таба</p> </div> <div class="tab-pane fade" id="profile"> <p>Содержание второго таба</p> </div> </div> 

How to implement a link to the content of the second tab from another page?

  • @Ponchik to that to automatically scroll to this table? - Lektor
  • Each tab has some content. For example, in the second tab there is an image of some products, clicking on this image I turn to the page of this product. When you return, I am not thrown on the same tab (the second), but on the first one. Is it possible to realize the return on the tab I need? - Ponchik
  • JS cookie or some get parameter in the address bar - Artem
  • @Ponchik try adding to link test.com/#home - Lektor
  • I didn’t quite understand the link, I don’t know JS (I just started studying), if you can, explain in more detail. - Ponchik

1 answer 1

Everything there works through anchors.

 <div class="tabbable"> <ul class="nav nav-tabs"> <li class="active"> <a href="#s1" data-toggle="tab">Первая секция</a> </li> <li> <a href="#s2" data-toggle="tab">Вторая секция</a> </li> <li> <a href="#s3" data-toggle="tab">Третья секция</a> </li> </ul> <div class="tab-content"> <div class="tab-pane active" id="s1"> <p>Сейчас вы просматриваете содержимое первой секции.</p> </div> <div class="tab-pane" id="s2"> <p>Сейчас вы просматриваете содержимое второй секции.</p> </div> <div class="tab-pane" id="s3"> <p>Сейчас вы просматриваете содержимое третьей секции.</p> </div> </div> </div> 

Notice id="s3" , id="s2" and so on. That is, if you add #s2 to the link, then the default tab and id = s2 will be opened.