jQuery Mobile 1.1.1自定义选择菜单-占位符文本不可见 [英] jQuery Mobile 1.1.1 Custom Select Menu - Placeholder Text not Visible

查看:114
本文介绍了jQuery Mobile 1.1.1自定义选择菜单-占位符文本不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在今天早些时候(2012年7月13日)升级到jQuery Mobile 1.1.1之后,我注意到我的所有自定义选择"菜单不再在页面加载时显示占位符文本.我需要在1.1.1中做些不同的事情以在自定义选择菜单中显示占位符文本吗?帮助!?!?

After upgrading to jQuery Mobile 1.1.1 earlier today (7/13/2012) I noticed that all of my Custom Select menus no longer show the placeholder text on page load. Is there something I need to do differently in 1.1.1 to show the placeholder text in custom select menus? Help!?!?

这是我的代码示例:

<div data-role="fieldcontain" class="ui-hide-label no-field-separator">
      <label for="ceiling" class="select" data-theme="a">Ceiling</label>
       <select name="ceiling" id="ceiling" data-theme="a" data-native-menu="false" class="required">
            <option data-placeholder="true">Ceiling (Yes/No)</option>
            <option value="Yes">Ceiling: Yes</option>
            <option value="No">Ceiling: No</option>
      </select>
</div>

样本图像(黑条是我的自定义选择菜单):

Sample image (the black bars are my custom select menus):

推荐答案

此代码对我有用:

<select>
  <option value="" data-placeholder="true">Choose one:</option>
  <option value="1">One</option>
  <option value="2">Two</option>
</select>

只需将value=""放在占位符选项上

Just put value="" on your placeholder option

这篇关于jQuery Mobile 1.1.1自定义选择菜单-占位符文本不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆