在ie10,9中选择选项(html 5标签)在下一个输入(html 5标签)的位置
select option (html 5 tag) position over next input (html 5 tag) in IE 10, 9
我已经下拉选择->选项"id="select_proptype"的值是动态生成的jquery函数…我也有其他的选择->选项,但动态选择位置出现在以下输入(html 5)标签的顶部…此行为仅在ie10和ie9中存在....
这是我的代码....
<div class="criteria_block">
<span><label class="search_form_Label" for="proptype">Property Type</label></span>
<span><select class="inputStyle_class" id="select_proptype" name="type" style="width:165px;"></select></span>
</div>
<div class="criteria_block">
<span><label class="search_form_Label default_font" for="postcodes">Post Codes</label></span>
<span><input class="inputStyle_class form_search_textbox" id="postcodes" style="width:160px;" name="postcodes" type="text" /></span>
</div>
在HTML中,我正在调用函数来获取所有值…
$(document).ready(function () {
$(this).SearchForm();
});
jquery插件功能..........
$.fn.SearchForm = function () {
//process the code//
//generate option values
for (var val in plugin_Global_Variables.F_property_Type) {
$("#select_proptype").append('<option value="' + plugin_Global_Variables.F_property_Type[val] + '">' + plugin_Global_Variables.F_property_Type[val] + '</option>');
}
}
css ----------------
.criteria_block {
display:block;
width:300px;
height:40px;
margin-top:10px;
color:#4E4E4E;
border:thin;
border-color:grey;
}
.search_form_Label {
display:inline-block;
width:100px;
font-weight:500;
margin-left:10px;
line-height:40px;
}
您正在使用.append()
添加内容-这会将您编写的代码添加到<select>
元素的开头。
你要找的是替换整个项目的集合只是替换整个html,像这样:
$("#select_proptype").html('<option value="' + plugin_Global_Variables.F_property_Type[val] + '">' + plugin_Global_Variables.F_property_Type[val] + '</option>');
或者可能一直只替换一个选项,在这种情况下,您需要以某种方式识别它(或者为它设置一个ID,如:)
$("#select_proptype").append('<option id="dynamicoption" value="' + plugin_Global_Variables.F_property_Type[val] + '">' + plugin_Global_Variables.F_property_Type[val] + '</option>');
,然后每次替换
$('#dynamicoption').remove();
$('#select_proptype').append('...');
或者像这样替换它,如果你知道它总是在列表的第一个:
$('#select_proptype option:first').remove();
$('#select_proptype').append('...');
你的。search_form_label的css宽度设置为100px,你的标签在哪里
<span><label class="search_form_Label" for="proptype">Property Type</label></span>
需要更多的宽度来显示"属性类型"在一行,这就是为什么你的选择选项的位置在下面的输入标签…
将宽度更改为100px+以适合框架....
.search_form_Label {
display:inline-block;
width:100px; // change width here to 100px +
font-weight:500;
margin-left:10px;
line-height:40px;
}
相关文章:
- 如何在tinymce编辑器中将点击事件绑定到html标签
- 如何将具有相同功能的两个select html标签的两个JS组合在一起
- 带有html标签的Summernote内容
- 为什么我的HTML标签消失了
- 如何忽略单词like“”中的未使用空格;测试-文本”;同时构建html标签
- 在AngularJS中过滤-html标签中的文本
- 如何在另一个 html 标签内选择 web 元素硒 Web 驱动程序与 html 源
- 我怎么能"合并”;两个HTML标签
- JavaScript if else 语句来显示 html 标签
- 在 JavaScript 中实现 HTML 标签
- 如何用jQuery替换HTML标签的一部分
- 在javascript文件中编写html标签而不是“text”
- 窗口确认在 AJAX 帖子中打印 HTML 标签
- 如何在javascript函数中弹出php(与html标签混合)文件
- HTML标签的问题与Javascript一致
- 使用Javascript获取所有html标签
- 如何从JavaScript外包HTML标签
- Ckeditor:如何在mysql中避免使用Ckeditor中的html标签来节省时间
- 如何在 jquery 和 javascript 中检索 html 标签属性
- 如何获取html标签的字体大小