Hi friends,

 I wanted to have a horizontal scrollbar for a <Select> so, I enclosed the
<Select> within a &ltDIV%gt. The result is coming perfectly fine. However if
the number of options in the list goes beyond 2000, then I see two Vertical
scrollbars(one for the list and one for the div). I am at a loss as to the
cause of it. For your convenience i have mentioned the code below. Please
copy and paste the options two a couple of thousands, then you will see the
second vertical scrollbar.


<html>
<head><title> Testing select option</title>
<script language="javascript">
function OnDivSrcScroll()
{
    if (SourceAccounts.options.length > 10)
    {
        SourceAccounts.size=SourceAccounts.options.length;
    }
    else
    {
        SourceAccounts.size=10;
    }
}

function OnSrcSelectFocus()
{

    if (document.getElementById("divSrcAccounts").scrollLeft != 0)
    {
        document.getElementById("divSrcAccounts").scrollLeft = 0;
    }

}
</script>
</head>
<body>

  <br><BR><HR>
  Please Choose
   <div id='divSrcAccounts'
    style="overflow:auto;position: relative;width:250px;HEIGHT: 200px;"
  onscroll="OnDivSrcScroll();" >

<SELECT size="17"
        name="SourceAccounts"  multiple onfocus="OnSrcSelectFocus();" >

        <OPTION value="109">109&nbsp;&nbsp;&nbsp;ABC CORPORATION</OPTION>
        <OPTION value="133">133&nbsp;&nbsp;&nbsp;XYZ
PHARMACEUTICALS</OPTION>
        <OPTION value="158">158&nbsp;&nbsp;&nbsp;LARSEN AND TUBRO</OPTION>
        <OPTION value="182">182&nbsp;&nbsp;&nbsp;BHARAT HEAVY
ELECTRICAL</OPTION>
        <OPTION value="109">109&nbsp;&nbsp;&nbsp;AIRTEL CORPORATION</OPTION>
        <OPTION value="133">133&nbsp;&nbsp;&nbsp;TATA TELESERVICES</OPTION>
        <OPTION value="158">158&nbsp;&nbsp;&nbsp;SUPER SALES
CORPORATION</OPTION>
        <OPTION value="182">182&nbsp;&nbsp;&nbsp;SALES EMPORIUM</OPTION>
        <OPTION value="109">109&nbsp;&nbsp;&nbsp;LUCKY ENTERPRISE</OPTION>
        <OPTION value="133">133&nbsp;&nbsp;&nbsp;IDEA CELLULAR</OPTION>
        <OPTION value="158">158&nbsp;&nbsp;&nbsp;NOMURA SECURITIES</OPTION>
        <OPTION value="182">182&nbsp;&nbsp;&nbsp;JP MORGAN</OPTION>
        <OPTION value="109">109&nbsp;&nbsp;&nbsp;RED LEVEL</OPTION>
</SELECT>
</DIV>
</body>
</html>
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to