PDA

View Full Version : Sencha touch zooming and panning



merl429
26 Mar 2011, 4:16 PM
hi, Ive read somewhere here and tested myself that the pinch listener doesn't work on android/phonegap. i would like to have an image display in its full resolution and let the browser take care of the zooming and panning of the image, as you would normally do using the mobile browser by dragging and pinching.

my code is simple, just an image on the panel. now how do i make the touch events go through and let the browser take care of it?

touchpad = new Ext.Panel({
fullscreen: true,
id: 'touchpad',
cls: 'myCls',
html: '<img id="focusImage" src="' + src + '" width="800" height="600" />',
});

Ext.getCmp("content").add(touchpad);
Ext.getCmp("content").setActiveItem('touchpad');

im using phonegap by the way in tandem with sencha touch.

now if i didnt use sencha touch, and used an html like this:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>test</title>
</head>
<body>
<img id="focusImage" src="images/IMG_1.jpg" class="divImage" width="1000" height="1000" />
</body>
</html>

it would allow me to pan the image. pinch zoom still doesnt work, but this would suffice for now. any help will be appreciated. thanks.