My question is straightforward. I have a div1
element with a variable offset().top
that adjusts based on other elements on the page. I am looking to add an absolutely positioned div next to it, which should have the same absolute top
value. This can be achieved using only CSS or with the help of JavaScript as well.
https://i.sstatic.net/WHk4X.png
The HTML structure is as follows
<div>
<div id="div2">stuff</div>
</div>
<div>
<div>some divs</div>
<div id="div1">div1 stuff </div>
</div>