JQuery Mobile 选择框不起作用
这有点疯狂了。 我已经尝试了几个小时的代码,但没有运气:
<div data-role="fieldcontain">
<label for="select-choice-1" class="select">Choose shipping method:</label>
<select name="select-choice-1" id="select-choice-1">
<option value="standard">Standard: 7 day</option>
<option value="rush">Rush: 3 days</option>
<option value="express">Express: next day</option>
<option value="overnight">Overnight</option>
</select>
</div>
来自:
http://jquerymobile.com/demos/1.0a4.1/#docs/forms/forms-selects.html
当我在手机上测试它时,没有下拉菜单......实际上,什么也没有发生全部。
我是不是忘记了什么?
This is getting a bit crazy.
I have been trying the code for hours now and no luck:
<div data-role="fieldcontain">
<label for="select-choice-1" class="select">Choose shipping method:</label>
<select name="select-choice-1" id="select-choice-1">
<option value="standard">Standard: 7 day</option>
<option value="rush">Rush: 3 days</option>
<option value="express">Express: next day</option>
<option value="overnight">Overnight</option>
</select>
</div>
From:
http://jquerymobile.com/demos/1.0a4.1/#docs/forms/forms-selects.html
When I test it on my mobile there is no dropdown ... actually, nothing hapens at all.
I'm I forgetting something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您查看网页的源代码,您可以看到它位于表单标记中:
因此,在表单标记之间添加此内容将获得所需的结果: 实时示例链接
另一个问题可能是:
尝试将此标记添加到下拉列表中:Live示例链接
If you look at the source of the web page you can see it's in a form tag:
So Adding this between the form tags would get the desired results: Live Example Link
Another problem it could be:
Try adding this tag to the dropdown: Live Example Link
我遇到了同样的问题,决定是在连接的库中,
我将其包含在头标记中,这个 css
和这个
都运行良好!
I had the same problem and the decision is in the connected libraries
I include in head tag this css
and this
and all works well!
看起来像是从链接直接复制粘贴,您是否包含 jquery 和 < a href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js" rel="nofollow">jquery mobile ?
looks like a direct copy paste from the link did you include jquery and jquery mobile ?
我最近遇到了这个问题,接受的答案并没有为我解决它。在创建问题的过程中,我找到了解决方案:
当同时使用 jQuery UI 和 jQuery Mobile 时,在脚本列表中,UI 必须位于 Mobile 之前。
我有这个:
这导致 UI 优先于我的表单元素,在选择菜单中尤其明显。我改变了这些说法,并且移动设备正确地增强了菜单。
I had this issue recently, and the accepted answer did not fix it for me. In the process of creating a question on it, I figured out the solution:
When using both jQuery UI and jQuery Mobile, UI must come before Mobile in your list of scripts.
I had this:
Which resulted in UI having precedence over my form elements, especially noticeable in select menus. I switched these statements, and the menus were enhanced by Mobile properly.