http://www.blueidea.com/bbs/NewsDetail.asp?id=251048http://www.blueidea.com/bbs/NewsDetail.asp?id=263438

解决方案 »

  1.   

    但是我隐藏不了select的滚动条呀。
    请看http://www.student.buct.edu.cn/colleges/2002huagong/index.htm
    其左下角有个select.其颜色有点不协调。像改掉。
      

  2.   

    <STYLE type="text/css">
    BODY {
    scrollbar-base-color: lightblue;
    }
    </STYLE>
    <script>
    str="";
    mywidth=0;
    lastobj=null;
    function showdiv(w,h)
    {
    document.all.mysel.style.display="none";
    str="<input type=text style='width:"+w+";border:1 solid #000000;' readOnly onclick=showlist() value="+document.all.mysel.options[document.all.mysel.selectedIndex].text+">";
    if(document.all.mysel.size!="")
    liststr="<table style='border:0' width="+(w-20)+" cellspacing=0 cellpadding=0>";
    else
    liststr="<table style='border:1 solid #000000;' width="+w+" cellspacing=0 cellpadding=0>";
    for(i=0;i<document.all.mysel.options.length;i++)
    liststr+="<tr><td style='font-size:10pt' onmouseover=myover() onmouseout=myout() onclick=myclick("+i+")>"+document.all.mysel.options[i].text+"</td></tr>";
    liststr+="</table>";
    if(document.all.mysel.size!="")
    {
    likesel.style.width=w-20;
    likesel.style.height=h;
    likesel.style.borderLeft="1 solid #000000";
    if(document.all.mysel.size>=document.all.mysel.options.length)
    likesel.style.borderRight="1 solid #000000";
    likesel.style.borderTop="1 solid #000000";
    likesel.style.borderBottom="1 solid #000000";
    likesel.innerHTML=liststr;
    }
    else
    likesel.innerHTML=str;
    mywidth=w;
    }function showlist()
    {
    likesel.innerHTML+=liststr;
    }
    function myover()
    {
    event.srcElement.style.cursor="default";
    if(document.all.mysel.size!="")
    return;
    event.srcElement.style.color="white";
    event.srcElement.style.background="darkblue";
    }
    function myout()
    {
    if(document.all.mysel.size!="")
    return;
    event.srcElement.style.color="";
    event.srcElement.style.background="";
    }
    function myclick(j)
    {
    document.all.mysel.selectedIndex=j;
    if(document.all.mysel.size!="")
    {
    if(lastobj!=null)
    {
    lastobj.style.color="";
    lastobj.style.background="";
    }
    event.srcElement.style.cursor="default";
    event.srcElement.style.color="white";
    event.srcElement.style.background="darkblue";
    lastobj=event.srcElement;
    }
    else
    {
    str="<input type=text style='width:"+mywidth+";border:1 solid #000000;' readOnly onclick=showlist() value="+document.all.mysel.options[document.all.mysel.selectedIndex].text+">";
    likesel.innerHTML=str;
    }
    }
    </script>
    <body onload="showdiv(mysel.offsetWidth,mysel.offsetHeight)">
    <select name=mysel size=4>
    <option value=11 selected>1111111
    <option value=12>111112
    <option value=13>1111111113
    <option value=14>45465113
    <option value=15>888888888113
    <option value=16>1000
    </select>
    <div id=likesel style="overflow-y:auto"><div>
      

  3.   

    to seabell(百合心)你坏!
    :)