What am I trying to do here:
I have an every time I The size of the window changes, then the special div can be changed, the Div's class properties are in an external CSS document with the class name '.nav'.
In HTML: & lt; Body onResize = "nav_resize ()" & gt;
In JS:
var w = window.innerWidth, h = window.innerHeight; Var nav = document.getElementsByClassName ('nav'); Function nav_resize () {if (w> 700) {nav.style.width = w-150}}
< Div class = "snippet" data-lang = "js" data-hide = "wrong">
.nav {background color: # 5F1C1C; Status: fixed; Swim left; Width: 190px; Minimum-width: 85px; Top: 105px; Height: 100vh; Hidden flurry; Z-index: 1; }
Any help appreciated.
No comments:
Post a Comment