jquery - Zoom in zoom out on touch devices -
i try zoom in zoom out on touch devices (like phone, tablets...)
function resizeimg(img) { var resize = 150; var origh = 61; var origw = 250; var mousex = event.x; var mousey = event.y; var newh = origh * (resize / 100); var neww = origw * (resize / 100); // set new width , height img.style.height = newh; img.style.width = neww; var c = img.parentnode; // work out new center c.scrollleft = (mousex * (resize / 100)) - (neww / 2) / 2; c.scrolltop = (mousey * (resize / 100)) - (newh / 2) / 2; }
<div id="container"> <img alt="click zoom" onclick="resizeimg(this)" src="http://www.logiticks.com/wp-content/themes/logiticksv4-theme/images/2015/12/datatable.jpg"/> </div>
firstly, i'm sorry limited knowledge problem. how can zoom in/zoom out img when run app on touch devices? mean, how can pinch gestures zooom in/out still in div tag (not zoom in/out page/browser)? :d
someone have experienced zooming, please give me idea this? thankful ^^
addition: resizeimg function. still doesn't work on touch devices , reaaly hard use :(
Comments
Post a Comment