【发布时间】:2017-03-23 15:50:34
【问题描述】:
我无法在文本输入旁边放置锚标记:
// Having this does not make a difference
//$( "#id_test" ).textinput( "option", "wrapperClass", "input-width" );
.input-width {
width: 200px;
}
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<div class="ui-field-contain">
<input id="id_test" maxlength="7" name="test" placeholder="Enter input" type="text" />
<a href="#some-help" data-rel="popup" data-transition="pop" class="ui-btn ui-btn-inline ui-shadow ui-corner-all ui-btn-icon-notext ui-icon-info" title="Learn more">Learn more</a>
<div data-role="popup" id="some-help">
<p>Some help here</p>
</div>
<!-- Having this instead of the above a and div tags makes no difference -->
<!-- <a href=#>Learn more</a> -->
</div>
即使 JS 代码不注释,字段宽度为 200px,锚标签仍然在下一行。如果我没有锚标记和 div 组合,而是包含未注释的锚标记,也没有关系。
【问题讨论】:
-
使用jQM网格系统。
-
网格系统导致将整个页面/包含的div分成两半、三等分。
-
不,它不会分割整个页面/容器。 demos.jquerymobile.com/1.4.5/grids
-
如果我为此使用了网格,那么我会有一行,其中一半宽度包含文本输入,而另一半只有图标。使用 DaniP 的解决方案,文本输入跨越屏幕的最大宽度,直到锚标记。
标签: jquery html css jquery-mobile