Currently, I am working on implementing a small feature but am facing difficulties with the scroll functionality. My goal is to zoom in on a specific div by scaling it using CSS:
transform: scale(X,Y)
The issue I am encountering lies in determining the correct left and top scroll values within the parent div. I need assistance in calculating the new left and top positions each time the user clicks on the "More zoom" button. If necessary, I am open to utilizing the translate CSS property.
I am open to using jQuery for this task, although I believe it boils down to a math problem :)
One important detail: It is essential that the image expands from the center.
Image Preview:
https://i.sstatic.net/YRl6S.jpg
You can find the code example here: