PDA

View Full Version : how to include pinch in a Carousel ?



ludm
22 Jun 2010, 2:55 AM
Hello,
First of all Sencha is a great idea / project!

I've made an app with 2 tabs composed of 2 Carousel, it works fine.

I want to add the pinch function on the images in the Carousel, Iv'e made like this, but it doesn't works:


items: [{
title: 'Image 1',
html: '<div id="picture"><img src="photos/miami/miami-beach01.jpg" /></div>'
}, {
....


With the event


Ext.fly('picture').on({
pinchstart : function(e, t) {
this.startScale = this.scale;
},

pinch : function(e, t) {
this.scale = e.scale * this.startScale;
t.style.webkitTransform = 'scale(' + this.scale + ')';
},

scope: {scale: 1}
});


What's wrong with my code ?

TommyMaintz
22 Jun 2010, 1:51 PM
It is hard to answer without seeing this code in context. My first guess would be that you are trying to bind the event listener before the component is rendered (and thus before the picture element exists).

ludm
23 Jun 2010, 12:51 AM
With this code it works in a simple page but not in the carousel, so I wonder if it doesn't come from the carousel


var page2 = new Ext.Component({
title: 'Pinch', // Name that appears on this tab
cls: 'page2', // The CSS class. Lets you style elements on the timeline.
scroll: 'vertical', // Make it vertically scrollable
html: '<div id="picture"><img src="photos/miami/miami-sunrise-2.jpg" /></div>',
});

TommyMaintz
24 Jun 2010, 10:38 AM
It might have something to do with the Carousel intercepting some of the touch events. This is a very specific case that I haven't tried or ran into yet. There are some things on our list that have high priority right now, but I definitely want to come back to this and see if we can get this to work. Is there a way you can work around this functionality for now?

bobh
18 Oct 2010, 2:14 PM
Hello. Just checking if any progress has been made on including a pinch function in a carousel -- I'd like to see a Sencha Touch photo album viewer that implements some of the functionality in the native "Photos" app on the iPad. Specifically, swiping left or right to view the next or previous photo, and pinching to zoom-in/out on the photo.
TIA.

elkidos
3 Nov 2010, 12:34 PM
+1 to be able to pinch images within a Carousel!

hitman01
22 Dec 2010, 8:49 AM
I would like to see better pinching/zooming support as well.

Jackalmurdoc
7 Sep 2011, 1:44 AM
Any news or updates about this, I could really use this.

Or if we can use the pinch functionality for an image in a carousel?

Any help is greatly appreciated.

Thanks

HadesKeeper
6 Oct 2011, 5:52 AM
I'm also interested in this. Any help or updates would be appreciated.

kaur_chit1
16 Jan 2012, 5:21 AM
No updates yet? Even I would like to implement touch and zoom into my carousel. If anyone has found a solution for it then kindly help. Thanks :)