I have a dropdownlist :
<
asp:DropDownList ID="ddl" runat="server" normalWidth="130px" width="130px" onmouseover ="expandDropDownList(this);" onclick="expandDropDownList(this);" onfocus="expandDropDownList(this);" onblur="collapseDropDownList(this);" onchange="collapseDropDownList(this);"></asp:DropDownList>
and the javascript is
function expandDropDownList(elementRef)
{
elementRef.style.width =
'auto';
}
function collapseDropDownList(elementRef)
{
elementRef.style.width = elementRef.normalWidth;
}
what happens is when i move the mouse over the control the width gets increased. but when i dont select anything and comeout, the width remains the same ..expanded. so i wrote onmouseleave event to collapse the width. because of this when i am trying to select an item in the ddl, the size shrinks automatically . and this looks awkward. can someone help