current tab active on page reload in php

Solutions on MaxInterview for current tab active on page reload in php by the best coders in the world

showing results for - "current tab active on page reload in php"
Jancis
15 Aug 2018
1$(document).ready(function() {
2    if (location.hash) {
3        $("a[href='" + location.hash + "']").tab("show");
4    }
5    $(document.body).on("click", "a[data-toggle='tab']", function(event) {
6        location.hash = this.getAttribute("href");
7    });
8});
9$(window).on("popstate", function() {
10    var anchor = location.hash || $("a[data-toggle='tab']").first().attr("href");
11    $("a[href='" + anchor + "']").tab("show");
12});
13