Answer the question
In order to leave comments, you need to log in
The anchor works only in an open tab on the current page. How to make it send from all tabs?
The page has several buttons (tabs) and a menu with links. These links should point to the contents of the tabs. In this case, I want the "Expandable Panel" link to point to the "CCS & Bootstrap" tab and then to the section that starts with "Expandable Panels". The problem is that the anchor works only when the "CCS & Bootstrap" tab is open, and if others are open, the anchor does not work.
Everything is built on Bootstrap 4.
Code where to send
Code where to send<a id="example-panels" name="example-panels"></a>
<a href="#example-panels">Разворачиваемая панель</a>
<a href="#example-panels" onclick="$('a[href=#example-panels]').tab('show'); return="false">Разворачиваемая панель</a>.
Answer the question
In order to leave comments, you need to log in
I found such a more or less option.
The button of the desired tab (tabs) contains id = "pills-css-tab", i.e. it is necessary that when you click on the link, the desired tab opens, and then the anchor works. To open the tab I used
$("#link-example-panel").click(function panel(){
$('#pills-css-tab').tab('show')
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question