我在Sencha Touch 2中遇到问题。我想在点击其他图像时隐藏图像。我怎么能这样做?
items: [{
xtype: 'panel',
html: '<img class="logo0" src="http://localhost/PlanningPoker/resources/images/carte0.png" /> '+
'<img class="logo1" src="http://localhost/PlanningPoker/resources/images/carte1.png" /> ',
listeners: [{
element: 'element',
delegate: 'img.logo0',
event: 'tap',
fn: function() {
console.log('One!');
}
},
{
element: 'element',
delegate: 'img.logo1',
event: 'tap',
fn:function() {
console.log('Two!');
}
}]
}]
答案 0 :(得分:1)
你去吧
Ext.Loader.setConfig({
enabled : true
});
Ext.application({
name : ('SF' || 'SenchaFiddle'),
launch : function() {
Ext.create('Ext.Panel', {
fullscreen : true,
items: [{
xtype: 'panel',
html: '<img class="logo0" src="http://25.media.tumblr.com/avatar_71ef465a7108_64.png" /><img class="logo1" src="http://existdissolve.com/wp-content/uploads/2010/08/sencha-logo-64x64.png" /> ',
listeners: [{
element: 'element',
delegate: 'img.logo0',
event: 'tap',
fn: function() {
Ext.DomQuery.select('img.logo1')[0].style.display = 'none';
}
}, {
element: 'element',
delegate: 'img.logo1',
event: 'tap',
fn:function() {
Ext.DomQuery.select('img.logo0')[0].style.display = 'none';
}
}]
}]
});
}
});
希望这有帮助