How to pan an inline SVG smoothly with Javascript
问题 In a Cordova/Android app that I am creating I have to implement my own zooming & panning (no libraries allowed nor suitable) of an inline SVG image. My effort thus far is shown below. var _hold = {zoom:1}; function preparePanZoom() { var actuY,scaleX,scaleY; _hold.factorX = 1600/window.innerWidth; actuY = (0.855*window.innerHeight); _hold.factorY = 770/actuY; _hold.displaceY = 0.145*window.innerHeight; scaleX = 1/_hold.factorX; scaleY = 1/_hold.factorY; _hold.panMax = [0,_hold.displaceY -