iFrame Extjs 5上的Pinch事件 [英] Pinch event on iFrame Extjs 5
本文介绍了iFrame Extjs 5上的Pinch事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想检测IFrame(Extjs 5组件)上的收缩事件. 这段代码怎么了?
I want to detect pinch event on an IFrame (Extjs 5 Component). What's wrong with this code??
Ext.create('Ext.ux.IFrame', {
autoScroll: true,
src: 'resources/docs/doc1.html',
cls: 'iframeStyle',
listeners: {
pinch: function (event) {
alert('event.scale= ' + event.scale);
}
}
})
推荐答案
现成的Ext.ux.Iframe没有捏"事件.只能使用侦听器"语法添加API上列出的事件. http://docs.sencha. com/extjs/5.0/5.0.1-apidocs/#!/api/Ext.ux.IFrame
Out of the box, Ext.ux.Iframe does not have "pinch" as an event. Only the events listed on the API can be added using the "listeners" syntax. http://docs.sencha.com/extjs/5.0/5.0.1-apidocs/#!/api/Ext.ux.IFrame
您想要一些类似的东西:
You'd want something along the lines of:
Ext.create('Ext.ux.IFrame', {
autoScroll: true,
src: 'resources/docs/doc1.html',
cls: 'iframeStyle',
listeners: {
afterrender: function(container) {
container.addManagedListener(container.el, "touchstart", function (event) {
alert('event.scale= ' + event.scale);
});
}
}
})
该代码未经测试,但是addManagedListener是您想要的!
The code is untested but addManagedListener is what you'll want!
这篇关于iFrame Extjs 5上的Pinch事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文