放大下拉列表 [英] Enlarge Drop Down List
本文介绍了放大下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我需要您的帮助,以使下拉列表在关闭时较小,但在打开时较大.
谢谢..
Hi to all,
I need you''re help in making a dropdown list that is small when closed but when opened the options are bigger.
Thanks..
推荐答案
编写一个JavaScript
函数,该函数将DropDownList
的宽度设置为所需的宽度,并调用DropDownList
的该函数onfocus
>.
就像这样:
Write aJavaScript
function which sets the width of theDropDownList
to the required width and call this functiononfocus
of theDropDownList
.
So something like:
<asp:DropDownList ID="DropDownList1" runat="server" Width="60px" onfocus="javascript:changeWidth();">
</asp:DropDownList>
Javascript:
Javascript:
function changeWidth()
{
document.getElementById("DropDownList1").style.width = "150px";
}
这篇关于放大下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文