【发布时间】:2011-09-16 20:57:23
【问题描述】:
我有一个清单:
<asp:ListBox ID="lstProblems" runat="server" SelectionMode="Multiple"></asp:ListBox>
我是这样填充的:
$(function() {
$.get('../file.txt', function(data) {
var output = data.split('\n'),
tmp = '';
for (i = 0; i < output.length; i++) {
tmp += '<option value=' + output[i] + '>' + output[i] + '</option>';
}
$('#lstProblems').html(tmp);
});
});
我想知道如何将其转换为常规 HTML 列表?因为这个问题,我需要这个:increase height of listbox in IE7
更新 我将 html 更改为:
<select size="4" name="lstProblems" multiple="multiple" id="lstProblems" CssClass="list-problems">
并将其添加到 css:
.list-problems {
height:600px !important;
display:inline-block;
}
IE 和 chrome 都没有发现差异
可能有什么东西可以覆盖这个吗?
这是我的所有内容,包括:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js" type="text/javascript"></script>
<link href="../niceforms/niceforms-default.css" rel="stylesheet" type="text/css" />
<script src="../niceforms/niceforms.js" type="text/javascript"></script>
<link href="../jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
这是来自 IE 的来源:http://pastebin.com/7vsF11Yq
【问题讨论】:
-
根据您在原始问题中的链接,它已经是一个常规的html列表。只需将
#lstProblems{height:200px !important; display:inline-block;}添加到您的 css 文件中 -
@joseph 请查看问题编辑。非常感谢您的帮助
标签: c# javascript asp.net html css