Answer the question
In order to leave comments, you need to log in
Trimming url in pathname, how?
There is a site on dle, it has Javascript code for tabs
<script type="text/javascript">
switch(window.location.pathname) {
case "/techit/":
document.getElementById("it").className += " tab-active3";
document.getElementById("mhead").className += " mhead-active";
document.getElementById("leftside").className += " leftside-active";
break;
case "/blogs/":
document.getElementById("blogs").className += " tab-active4";
document.getElementById("mhead").className += " mhead-active1";
document.getElementById("leftside").className += " leftside-active1";
break;
case "/game/":
document.getElementById("game").className += " tab-active2";
document.getElementById("mhead").className += " mhead-active3";
document.getElementById("leftside").className += " leftside-active3";
break;
case "/lhack/":
document.getElementById("lhack").className += " tab-active55";
document.getElementById("mhead").className += " mhead-active4";
document.getElementById("leftside").className += " leftside-active4";
break;
case "//":
default:
document.getElementById("maintab").className += " tab-active1";
document.getElementById("mhead").className += " mhead-active2";
document.getElementById("leftside").className += " leftside-active2";
} </script>
Answer the question
In order to leave comments, you need to log in
If it's difficult with js, take a ready-made plugin, for example: vdw.github.io/Tabslet
You can set an active taboo in it.
Then you already need to dig in this dle of yours, maybe those who understand it will tell you.
I can only dream up, I'm sure in reality everything will be even simpler than my fantasies.
For example, there is a blogs section template.
Add code to it
In the news template, respectively
Well, when initializing tabs
$('.tabs').tabslet({
active: self.activeTab
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question