[Solved] Getting position in js [closed]
There are two ways to achieve this… 1) Pure CSS You can use the position sticky. body { /* ?? Just added, so you can scroll on page */ height: 200vh; } #box { margin-top: 80px; position: sticky; background-color: blueviolet; width: 100%; height: 80px; top: 0; } <div id=”box”></div> position Documentation 2) Javascript Here we … Read more