我有两个JQM按钮:
<a id="clearA" href="#" data-role="button">Clear a</a>
<a id="clearB" href="#mainPage" data-role="button">Clear b</a>我正在连接点击事件(超级链接/按钮"clearA")如下:
$("#clearA").click(function (e) {
e.stopImmediatePropagation();
e.preventDefault();
console.log("Me? I got clicked");
});当我单击"clearA“时,事件会被触发,但按钮不会显示按下的动画/状态。如果我点击“非连线”按钮"clearB",按钮就会有动画。
为什么按钮"clearA“没有动画?
使用jqm1.1.0的更新
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.js"></script>发布于 2012-04-05 11:51:49
使用来自cdn的最新版本的jquery移动电话运行这段代码--这两个按钮的工作方式完全一样--您能尝试使用下面的版本来查看它是否适合您吗?
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>更新:
Jqm1.1仍然是一个不稳定的版本,它有一些粗糙的边缘。使用该版本,没有一个按钮适合我,这似乎是因为库没有将主题数据属性正确地分配给按钮。
添加此小修改(以diff格式)工作:
4216a4217,4218 > e.setAttribute( "data-" + $.mobile.ns + "theme", o.theme ); https://stackoverflow.com/questions/10027441
复制相似问题