可能的重复:
调整下拉框中列表的高度 https://stackoverflow.com/questions/5600646/adjust-the-height-of-the-list-in-dropdown-box
hi
如何调整下拉列表中列表的高度,因为下拉框中加载了太多值。例如,它只显示 10 个条目,并使用滚动条查看剩余条目。有谁知道这是怎么做到的吗?看我附上的图片你可能会更清楚。
this is what I want. it only show 5 entries, and with scrollbars to see remaining.
如果您使用 HTML,则实际上无法控制下拉框的大小。有一些方法可以使用 div 和滚动条来伪造它,但这是不同的
这并不容易,需要几个嵌套的 CSS 样式和一些 Javascript,但 HTML 如下。它的操作基本上类似于 SharePoint 样式的下拉框,具有一些过度效果,并且单击时会打开滚动选项。
<table cellspacing="0" cellpadding="0" class="spsItems">
<tbody>
<tr contextmenuid="options-aaa" class="people_display">
<td class="spsContext">Current Option</td>
</tr>
<tr contextmenuid="options-bbb" class="people_display">
<td class="spsContext">Current Option</td>
</tr>
<tr contextmenuid="options-bbb" class="people_display">
<td class="spsContext">Current Option</td>
</tr>
</tbody>
</table>
<div id="options-aaa" class="spsContextMenu" >
<ul>
<li>Option Value</li>
<li>Option Value</li>
.....
<li>Option Value</li>
<li>Option Value</li>
</ul>
</div>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)