Good evening to all gentlemen
//js var scrollWidth = document.documentElement.scrollWidth; var realW = scrollWidth;
we have variables about the actual size of the window that the user is watching. Eats, but you can change the size of the screen (do not on the whole screen, but on a part) Suppose there is a width of 1000px and the user is walking around the browser width, it is wider then ..
Is it possible to change the class of the divs in the round-trip style when changing the real width of the browser window?
//html <div id="a1" class="a1"> <div id="a11" class="a11"> 11 </div> <div id="a12" class="a12"> 12 </div> <div id="a13" class="a13"> 13 <div id="a131" class="a131"> 131 </div> <div id="a132" class="a132"> 132 </div> </div> </div>
For example, if we load the page, we immediately check if realW> 1000 - the style is one, if it is less - the styles are different, but when the window is changed - it is recalculated and changed automatically, i.e. in my case, the replacement of these classes
если ширина уменьшается стала меньше 1000, меняем классы у id1 -> class="a1s" id11 -> class="a11s" id12 -> class="a12s" id13 -> class="a13s" id131 -> class="a131s" id132 -> class="a132s" если ширина уменьшается стала больше 1000, меняем классы на те, что были изначально id1 -> class="a1" id11 -> class="a11" id12 -> class="a12" id13 -> class="a13" id131 -> class="a131" id132 -> class="a132"