How to zoom on a point with JavaScript?
问题 My web project needs to zoom a div element around the mouse position as anchor while mouse wheeling, I was inspired by @Tatarize 's answer at Zoom in on a point (using scale and translate), but I can't implement it exactly, it can't zoom and translate around the mouse position, can any one help? window.onload = function() { const STEP = 0.05; const MAX_SCALE = 10; const MIN_SCALE = 0.01; const red = document.getElementById('red'); const yellow = red.parentNode; let scale = 1; yellow