Good evening everybody.
I use JaLawfirm, I set up Bootstrap tabs like in the "Typography" page of the demo site. (Navigation-Tabs)
However, I'd like the site to show the last tab selected before reloading the page. In other words, after reloading the page I'd like to see the last tab selected before reloading the page.
To this aim, I have this javascript code:
<script type="text/javascript">
$(function() {
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
// save the latest tab;
localStorage.setItem('lastTab', $(this).attr('href'));
});
// go to the latest tab, if it exists:
var lastTab = localStorage.getItem('lastTab');
if (lastTab) {
$('[href="' + lastTab + '"]').tab('show');
}
});
</script>
I tested it on a web page I set up with the same tabs, it works perfectly.
The problem is, I can't get it to integrate these few lines in joomla.
I added the code in T3 (add custom code) both before and after <head>; but it never works.
After reloading the page, the page still shows the first tab selected.
I'd really appreciate your help in solving this problem; for any reference, you can consider the Tabs in the Typography page of the demo site.
Thank you in advance