Answer the question
In order to leave comments, you need to log in
How to open a page with the right hashtag?
Hello everyone, and in particular to front-enders and layout gurus.
How can I implement the opening of a tab in the following path '/***/#signatures'?
There is a navigation
<ul class="nav nav-tabs" id="orderlist" role="tablist">
<li class="nav-item">
<a class="nav-link" id="general-tab" data-toggle="tab" href="#general" role="tab"
aria-controls="general" aria-selected="true">General
</a>
</li>
<li class="nav-item">
<a class="nav-link active" id="package-tab" data-toggle="tab" href="#package"
role="tab" aria-controls="package" aria-selected="false">Package
</a>
</li>
<li class="nav-item">
<a class="nav-link" id="payments-tab" data-toggle="tab" href="#payments" role="tab"
aria-controls="payments" aria-selected="false">Payments
</a>
</li>
<li class="nav-item" id="loan-tab-menu" t-att-style="'display: none' if contract.type == 'guest' else empty">
<a class="nav-link" id="loans-tab" data-toggle="tab" href="#loans" role="tab"
aria-controls="loans" aria-selected="false">Loans
</a>
</li>
<li class="nav-item">
<a class="nav-link" id="signatures-tab" data-toggle="tab" href="#signatures" role="tab"
aria-controls="signatures" aria-selected="false">Signatures
</a>
</li>
<li class="nav-item">
<a class="nav-link" id="cards-tab" data-toggle="tab" href="#cards" role="tab"
aria-controls="cards" aria-selected="false">Credit Cards
</a>
</li>
</ul>
<div class="tab-pane" id="signatures" role="tabpanel" aria-labelledby="signatures-tab">
$(function () {
if (location.hash) {
$(location.hash + '-tab').click();
}
$("a[data-toggle=tab]").on("click", function () {
location.href = this.href;
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question