IE 7.0 Select box overlap over button
My google skills are falling me. I'm having the following issue in IE 7.0 (works in FF 4.0 & Chrome)
I initially have an empty select box. When I fill it values using Jquery, the select box is overlapping over the button.
I'm assuming there's a css hack for it but I'm not getting the proper search results.
I have the following bit of code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js">
</script>
</head>
<body>
<div>
<select id="missionList" name="missionList">
<option></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<select name="peopleList" id="slPeopleFoundList" size="5" multiple="multiple">
</select>
<input type="submit" id="Remove" value="Remove" disabled="disabled" />
</div>
</body>
</html>
<s开发者_如何学JAVAcript type="text/javascript">
$(function () {
$("#missionList").change(function () {
SetupUpMissionList();
});
function SetupUpMissionList() {
var select = $("#slPeopleFoundList");
appendOption("he asdfasdfasdf asdf asdf asdfllo", "hello", select);
}
function appendOption(text, value, select) {
$(select).
append($("<option></option>").
attr("value", value).
text(text));
}
});
</script>
Stupid, stupid IE. I tried adding .hide()/.show() around the code that adds options to the select element and it kind of worked, like so:
select.hide();
appendOption("he asdfasdfasdf asdf asdf asdfllo", "hello", select);
select.show();
精彩评论