额外的容器出现在jQuery Mobile 1.4.2中的按钮周围 [英] Extra container appearing around button in jQuery Mobile 1.4.2
问题描述
我在jQuery Mobile 1.4.2中有一个<button>
,其中显示了一个<div>
容器.我在jQM 1.3.2中没有这个问题.
I have a <button>
in jQuery Mobile 1.4.2 that's being shown with an extra <div>
container appearing around it. I did not have this problem with jQM 1.3.2.
这是我正在使用的代码(请注意,问题没有出现在jsFiddle 中):
This is the code I'm using (note that the problem doesn't appear in jsFiddle):
<div data-theme="a" data-role="page">
<div role="main" class="ui-content">
<button id="test1" data-inline="true" data-mini="true" title="test1">Test 1</button>
</div>
</div>
这是显示jQM插入的额外div的小提琴: Demo With Extra Div
And this is the fiddle that shows the extra div inserted by jQM: Demo With Extra Div
如何摆脱多余的股利?
推荐答案
从jQuery Mobile 1.4开始,仅将.button()
用于类型为button
,submit
或reset
的input
.
As of jQuery Mobile 1.4, use .button()
only for input
with type button
, submit
or reset
.
input
转换为包含所有样式的div.
input
is converted into a div that holds all styles.
<div class="ui-btn ui-input-btn ui-corner-all ui-shadow">
Submit
<input type="submit" value="Submit">
</div>
如果您在<a>
或<button>
标签上调用.button()
,它们将被包装在div中.
If you call .button()
on <a>
or <button>
tags, they will be wrapped in a div.
这篇关于额外的容器出现在jQuery Mobile 1.4.2中的按钮周围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!