I would put the image in the “viewport” layer, which is used to maintain the flow of your page. A viewport would have an overflow CSS property set to hidden to achieve this.
You can then use JavaScript to detect multiple touches, and then scale the image as needed. I still need to use these frameworks, but it seems very cool and can help make it easier for you: https://github.com/HotStudio/touchy
You can also detect multiple touches without a frame by observing the event.touches array inside the event handler for touchmove . For each touch that event.touches simultaneously, event.touches will be another index in the event.touches array.
Using Touchy seems pretty simple (untested):
var handleTouchyPinch = function (e, $target, data) { $target.css({'webkitTransform':'scale(' + data.scale + ',' + data.scale + ')'}); }; $('#my_div').bind('touchy-pinch', handleTouchyPinch);
source share