- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 sencha touch 开发移动网络应用程序。我使用以下代码创建了一个按钮
{
xtype: 'button',
cls: 'messagesBtn'
}
在 App.scss 中,我添加了以下 css,将此按钮的背景更改为图像
.messagesBtn {
height: 50%;
background: url(../images/home.png) no-repeat;
}
现在这个 css 可以工作了,但是当我按下那个按钮时,它不会删除那个图像并向它添加另一个我不想要的状态。我希望当用户按下此按钮时,应将另一张图片替换为当前图片。 我怎样才能做到这一点?
更新
我更改了我的代码并添加了 pressedCls
{
xtype: 'button',
cls: 'messagesBtn',
pressedCls: 'x-button-pressed'
}
这是CSS
.messagesBtn {
background: url(../images/home.png) no-repeat;
}
.x-button-pressed {
background: url(../images/appointments.png) no-repeat;
}
以上也不行。
最佳答案
无需更改按钮的代码,您可以使用此 CSS:
.messagesBtn {
// Your CSS for the normal state
}
.messagesBtn.x-button-pressing {
// Your CSS for the pressing state
}
更新
相关阅读:CSS Priority Order
此外,请始终使用 Web Inspector 或 Firebug 检查您的 CSS 是否应用于正确的元素,以及它是否未被其他 CSS 类覆盖
关于javascript - 如何在sencha touch中改变按钮的按下状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15354219/
我有一个基于 的项目 Sencha 触控 v2.0.x ,我在 中处理它 Sencha 建筑师2.0 .现在我更新了 Sencha 建筑师至 2.1 并希望更新我的项目以使用 Sencha 触控 2.
我已经制作了我的应用程序,现在我想打包它,所以我转到包含以下内容的终端中的应用程序目录 /app /app.js /app.json /resources /index.html /touch 我运行
我已经制作了我的应用程序,现在我想打包它,所以我转到包含以下内容的终端中的应用程序目录 /app /app.js /app.json /resources /index.html /touch 我运行
大家好,我是 sencha 的新手,我试图找出 sencha architect/sencha touch 中的一些东西是如何工作的。 我找到了一个项目 http://miamicoder.com/2
有人可以给我写完整的代码来告诉我如何使用 sencha touch 1 淡入和淡出 html 元素吗?具体来说,我需要知道需要包含哪些 html、javascript 和 css 文件。 我一直试图获
我正在尝试使用 sencha touch 的列表分页插件。但是几乎没有关于如何使用它的好(或坏)文档,我很困惑。 当我激活列表中的插件时 this.myList = new Ext.List({
我想要一个水平旋转木马,每个面板的内容都可以垂直滚动。目前,内容在屏幕底部被截断,我无法向下滚动内容。我将此代码用于轮播: Pages.Portfolio = new Ext.Carousel({ t
我正在用sencha touch做一个项目,但我需要连接相机iPad来拍照。开发是通过网络进行的。请帮助我,我找不到解决方案。 谢谢。 最佳答案 如文档中所述:“Sencha Touch 使您能够快速
我是移动技术的新手。我想用Sencha touch创建我的个人投资组合。 我需要为此付费吗? 最佳答案 不,你不会的。我还是建议您使用商业许可证,因为它是免费的,并且对您的操作有较少的限制。您只需要付
我下载了sencha touch 并提取到一个文件夹中。 然后我下载了the sdk tool 并安装它。 使用windows 7 cmd,cd到sencha touch文件夹,然后运行sencha
我的移动应用程序目前在 Sencha Touch 1.1.1 下运行。现在,我想将其升级到 Sencha Touch 2.0。有人可以帮我做这件事吗?升级时我应该注意哪些一般步骤? 另外,是否有帮助该
我只是找不到解决方法,请帮助 我的 config.rb 位于 $PROJECT_HOME/assets/www/theming 位置 dir = File.dirname('..Path_to_pr
在他们的文档中找不到指定了所有日期时间格式的位置? 我想要一个日期看起来像这样 13 Jan 2013 我发现了这个模式: date("F j, Y") 但这给了我很长的月份名称。 (不知道为什么他们
我需要一个简单的嵌套 ListView 示例。沿着这条线的东西...... (来源:roosteronacid.com) 当您单击一个项目时,您将转换(滑动)到包含另一个列表的下一个 View /卡片
我有一个 sencha touch 显示在列表中的联系人列表。然后,当您单击列表中的姓名时,它应该向右滑动并说您好 {联系人姓名}!但是当它现在滑过时,它只是说你好!第 29 行是项目点击的 Acti
我是一名 Ext 老手,但我需要创建一些相当简单的移动应用程序,自然而然我正在研究 sencha touch。 Ting 是 - 大多数示例无法在 Firefox/Opera 中运行。 我很高兴使用
我有一个关于 xtypes 的问题。当我这样做时: // map var map = new Ext.map({ fullscreen: true, getLocation: true
我使用 sencha create app 命令创建了我的应用程序。它在我的机器上以及我们的 Web 服务器上都可以本地运行。我正在尝试构建用于生产的应用程序,但以下命令对我不起作用: sencha
只是想知道在 Sencha Touch 中是否有处理该问题的方法。一个商店,应用不同的过滤器后,商店可以用于不同的地方。 例如: 我有一家商店: Ext.regModel('abc', { f
我想使用 sencha touch 创建自定义工具栏。使用 Ext.Toolbar,我能够创建一个像样的屏幕标题栏。但我的要求是将我公司的品牌形象标志放在标题栏的中央,而不是下面代码提供的简单文本。
我是一名优秀的程序员,十分优秀!