forked from laksa19/mikhmonv3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmikhmon-ui.green.min.js
1 lines (1 loc) · 2.38 KB
/
mikhmon-ui.green.min.js
1
var i,sidenav=document.getElementById("sidenav"),main=document.getElementById("main"),openNav=document.getElementById("openNav"),closeNav=document.getElementById("closeNav"),overL=document.getElementById("overL"),menu=document.getElementsByClassName("menu"),dropdownbtn=document.getElementsByClassName("dropdown-btn"),dropdownContainer=document.getElementsByClassName("dropdown-container");openNav.addEventListener("click",function(){var e=window.innerWidth;for(e<800?(main.style.marginLeft="0",sidenav.style="width: 210px; border-right: 1px solid #3BB766"):e>800&&(main.style.marginLeft="210px",sidenav.style="width: 210px; border-right: 1px solid #3BB766"),i=0;i<menu.length;i++)menu[i].style.display="block";for(i=0;i<dropdownbtn.length;i++)dropdownbtn[i].style.display="block";for(i=0;i<dropdownContainer.length;i++)dropdownContainer[i].style.display="";openNav.style.display="none",closeNav.style.display="block"}),closeNav.addEventListener("click",function(){for(main.style.marginLeft="0",sidenav.style="width: 0; border-right: 0",i=0;i<menu.length;i++)menu[i].style.display="none";for(i=0;i<dropdownbtn.length;i++)dropdownbtn[i].style.display="none";for(i=0;i<dropdownContainer.length;i++)dropdownContainer[i].style.display="none";openNav.style.display="block",closeNav.style.display="none"}),document.getElementsByTagName("BODY")[0].onresize=function(){var e=window.innerWidth;if(e<800){for(main.style.marginLeft="0",sidenav.style="width: 0; border-right: 0",i=0;i<menu.length;i++)menu[i].style.display="none";for(i=0;i<dropdownbtn.length;i++)dropdownbtn[i].style.display="none";for(i=0;i<dropdownContainer.length;i++)dropdownContainer[i].style.display="none";openNav.style.display="block",closeNav.style.display="none"}else if(e>800){for(main.style.marginLeft="210px",sidenav.style="width: 210px; border-right: 1px solid #3BB766",i=0;i<menu.length;i++)menu[i].style.display="block";for(i=0;i<dropdownbtn.length;i++)dropdownbtn[i].style.display="block";for(i=0;i<dropdownContainer.length;i++)dropdownContainer[i].style.display="";openNav.style.display="none",closeNav.style.display="block"}};var dropdown=document.getElementsByClassName("dropdown-btn");dropdown=document.getElementsByClassName("dropdown-btn");for(i=0;i<dropdown.length;i++)dropdown[i].addEventListener("click",function(){this.classList.toggle("active");var e=this.nextElementSibling;"block"===e.style.display?e.style.display="none":e.style.display="block"});