<nav data-v-7777777="" class="nav">
<div data-v-7777777="" class="active items">1</div>
<div data-v-7777777="" class="items">2</div>
<div data-v-7777777="" class="items">3</div>
<div data-v-7777777="" class="items">4</div>
</nav>
var items_element
var page_url
window.onload = function () {
page_url=window.location.href;
items_element = document.getElementsByClassName(‘items’);
if(page_url.indexOf(“buy”)>0){
reset(1);
}
if(page_url.indexOf(“download”)>0){
reset(2);
}
if(page_url.indexOf(“explain”)>0){
reset(3);
}
this.console.log(page_url);
this.console.log(items_element);
items_element[0].οnclick=function(){
window.location.href=“index.html”;
}
items_element[1].onclick = function () {
window.location.href = “buy.html”;
}
items_element[2].onclick = function () {
window.location.href = “download.html”;
}
items_element[3].onclick = function () {
window.location.href = “explain.html”;
}
}
function reset(index){
for(var i=0;i<4;i++){
items_element[i].className=“items”;
}
items_element[index].className += " active";
}
active[data-v-7777777] {
color: #3373fc
}