我对煎茶很陌生。所以我想显示,当点击按钮然后改变以前图像的图像。
更多关于图片:在这张图片中,当加载文件时,红色按钮出现,我想点击确定按钮将红色变为绿色。
这是我在 Main.js 中的代码:但无法更改:
{
xtype: 'image',
width:33,
height:33,
src:'resources/images/online.png'
},
{
xtype: 'button',
text:'Go Online?',
cls: 'messagesBtn',
pressedCls: 'x-button-pressed'
listeners: {
tap: function (button, e, eOpts) {
//console.log('hello');
if (!Ext.device.Connection.isOnline()) {
console.log('Connected (' + Ext.device.Connection.getType() + ')');
.wishlogbtn
{
background-image: url('resources/images/Online.png') !important;
}
}
else {
console.log('Offline');
button.setText('Go Offline?');
.wishlogbtn
{
background-image: url('resources/images/Offline.png') !important;
}
}
}
}
在 app.css 文件中:
.messagesBtn {
background: url(resources/images/online.png) no-repeat;
}
.messagesBtn.x-button-pressing {
background: url(../images/offline.png) no-repeat;
}
我在控制台上收到此错误:
Uncaught SyntaxError: Unexpected identifier Main.js:132
Uncaught Error: The following classes are not declared even if their files have been loaded: 'test.view.Main'. Please check the source code of their corresponding files for possible typos: 'app/view/Main.js