Jquery mobile jquery移动按钮未隐藏在样式中
大家好,我们正在研究jquerymobile如何使用css隐藏按钮,而不是使用display的代码:样式中没有,但它不适用于jquerymobile 下面是我们正在使用的代码Jquery mobile jquery移动按钮未隐藏在样式中,jquery-mobile,Jquery Mobile,大家好,我们正在研究jquerymobile如何使用css隐藏按钮,而不是使用display的代码:样式中没有,但它不适用于jquerymobile 下面是我们正在使用的代码 <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
</head>
<body>
<div data-role="page" id="pageone">
<div data-role="header">
<h1>Buttons</h1>
<button data-role="button" style="display:none;">hello</button>
</div>
<div data-role="footer">
<h1>Footer Text</h1>
</div>
</div>
</body>
</html>
按钮
你好
页脚文本
#pageone.ui头>.ui btn{display:none;}
首先,尝试编辑属性,如“display:none!important”。
如果它还没有工作,那么检查是否为按钮声明了“display:block!important;”属性。
(或)
在内部/外部样式表中编写个人样式,如
#pageone.ui header>.ui btn{显示:无!重要;}
如果要随代码移动,请将“显示:无”更改为可见性:隐藏
或
$(“.target”).hide()代码>
这大致相当于调用.css(“display”、“none”)
,不同的是display属性的值保存在jQuery的数据缓存中,以便以后可以将display恢复为其初始值。如果一个元素的显示值为inline,并且隐藏后显示,它将再次以内联方式显示。最简单的方法是将按钮包装在DIV中,然后隐藏/显示它
<div style="display:none;">
<button data-role="button">hello</button>
</div>
你好
<div style="display:none;">
<button data-role="button">hello</button>
</div>