下拉框显示的高度 [英] height of the dropdown box display

查看:88
本文介绍了下拉框显示的高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
调整下拉框中列表的高度

Possible Duplicate:
adjust the height of the list in dropdown box

如何在下拉列表中调整列表的高度,因为下拉框中加载的值太多.例如,它仅显示10个条目,并带有滚动条以查看剩余的条目.有谁知道这是怎么做到的吗?您可能会更清楚地看到我的所附图片.

how can I adjust the height of the list in the dropdown because I have too many values loaded in the drop down box. For example, it only show 10 entries, and with scrollbars to see remaining. does anyone know how to do that? you may more clear to see my attached picture.

这就是我要的.它仅显示5个条目,并带有滚动条以查看剩余条目.

this is what I want. it only show 5 entries, and with scrollbars to see remaining.

推荐答案

如果使用HTML,则实际上无法控制下拉框的大小.有一些使用div和滚动条伪造它的方法,但这是不同的

You can not actually control the size of the dropdown box if you are using HTML . There are some ways to fake it using divs and scroll bars, but that is different

这并不容易,并且需要几种嵌套的CSS样式和一些Javascript,但是下面是HTML.它基本上就像一个SharePoint样式下拉框一样工作,具有一些过度效果,并且在单击时打开滚动选项.

This is not easy, and requires several nested CSS styles and some Javascript but the HTML is below. It basically operates like a SharePoint style dropdown box, with some over effects and on click opens the scrolling options.

<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>

这篇关于下拉框显示的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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