$(document).ready(function() { if (window.location.href.indexOf("privacypolicy") > -1) { window.location.href = "/terms-of-use/privacy" } if (window.location.href.indexOf("/termsofuse") > -1){ window.location.href = "/terms-of-use/terms"; } var ele = document.querySelector('.about-vertical-menu.privacy-policy-vertical-menu'); checkWidth(ele); window.addEventListener('resize', function() { console.log("I am resizing"); checkWidth(ele); }, true); }); //document.querySelector('a[href="#privacypolicy"]').removeAttribute("data-toggle"); //document.querySelector('a[href="#privacypolicy"]').href="/terms-of-use/privacy"; //document.querySelector('a[href="#termsofuse"]').removeAttribute("data-toggle") //document.querySelector('a[href="#termsofuse"]').href="/terms-of-use/terms"; function checkWidth(ele) { let windowWidth = window.innerWidth; console.log(windowWidth); if ((windowWidth < 1116 && windowWidth > 767) || windowWidth > 1116) { ele.style.display = "block"; } else if (windowWidth < 767 && ele.style.display === "block") { ele.style.display = "none"; } } function openTabs () { //console.log("tabs"); var elems = document.getElementsByClassName("about-vertical-menu"); var spanelem = document.getElementsByClassName("policy-caret"); //console.log(spanelem); if(elems[0].classList.contains('fa-angle-down')){ elems[0].style.display = 'block'; spanelem[0].classList.remove("fa-angle-down"); spanelem[0].classList.add("fa-angle-up"); return; } else if (elems[0].classList.contains('fa-angle-up')) { elems[0].style.display = 'none'; spanelem[0].classList.remove("fa-angle-up"); spanelem[0].classList.add("fa-angle-down"); return; } }