So I have a container that I want to scale up and down (zoom in and out) but to also have its expanded/shrunk form to take up space rather than just overlapping other stuff.
Update
There is an image with which there are absolute
divs that are placed in coordinates, they must retain their relative positions when sizing up and down (hence why I'm using scale).
var b = document.getElementById("outer");
var scale = 1;
function increase() {
scale += 0.1
b.style.transform = `scale(${scale})`;
}
function decrease() {
scale -= 0.1
b.style.transform = `scale(${scale})`;
}
#outer {
overflow-x: auto position: relative;
transform-origin: left top;
}
.pointer {
width: 20px;
height: 20px;
background-color: orange;
position: absolute;
}
#a1 {
top: 50px;
left: 150px;
}
#a2 {
top: 150px;
left: 50px;
}
#a3 {
top: 250px;
left: 550px;
}
<div>
<button onclick="increase()">Increase</button>
<button onclick="decrease()">Decrease</button>
</div>
<div id=outer>
<img src="http://via.placeholder.com/600x350" />
<div id="a1" class='pointer'>
</div>
<div id="a2" class='pointer'>
</div>
<div id="a3" class='pointer'>
</div>
</div>
<div>
please don't cover me
</div>
Would rather not have third party libraries (beside jQuery) but may consider.