http://expert.csdn.net/Expert/TopicView2.asp?id=1219731&datebasetype=now

解决方案 »

  1.   

    如果你浏览器安全级别允许的话,可以用下面的代码<select id=s1>
    <option >1</option>
    <option >2</option>
    <option >3</option>
    <option >4</option>
    <option >5</option>
    <option >6</option>
    </select>
    <input type=button id=b1 value=go onclick="aa()">
    <script>
    function aa(){
    var f=new ActiveXObject("WScript.SHELL");
    s1.focus();
    f.SendKeys("%{DOWN}");
    }
    </script>
      

  2.   

    <html><head>
    <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    </head>
    <script>
    function downlist(thelist)
    {
    var listHtml = thelist.outerHTML;
    listHtml ="<select size='4' multiple id='downlist' name='downlist' onchange='changeValue(this)'></select>"
    var tmpList = document.createElement(listHtml);
    tmpList.style.position= "absolute";
        tmpList.style.pixelLeft = getLeftPostion(thelist);
        tmpList.style.pixelTop  = getTopPostion(thelist)+20;
    document.form1.appendChild(tmpList);
    for(i=0;i<thelist.length;i++){
     var oOption = document.createElement('OPTION');
            oOption.text = thelist.options[i].text;
            oOption.value =thelist.options[i].value;
    tmpList.options.add(oOption);
    }}
    function changeValue(the)
    {
    document.form1.D1.options[the.selectedIndex].selected=true;
    document.form1.removeChild(window.document.getElementById("downlist"));
    }
    function getLeftPostion( theObj )
    {
      var pos = 0;
      while ( theObj != null )
      {
        pos += theObj.offsetLeft;
        theObj = theObj.offsetParent;
      }
      return pos;
    }
    function getTopPostion( theObj )
    {
      var pos = 0; 
      while ( theObj != null )
      {
        pos += theObj.offsetTop;
        theObj = theObj.offsetParent;
      }
      return pos;
    }
    </script>
    <body><form name="form1" method="POST" action="--WEBBOT-SELF--">
      <select size="1" name="D1">
      <option>黄花菜1</option>
        <option>黄花菜2</option>
      <option>黄花菜3</option>
        <option>黄花菜4</option>  </select><br>
      <input type="button" value="按钮" name="B1" onclick="downlist(document.form1.D1)"><input type="reset" value="重置" name="B2"></p>
    </form></body></html>
      

  3.   

    <BODY onmouseover="if (event.srcElement.tagName!='SELECT')document.all.tags('SELECT')[0].size=1">
    <select onmouseover="size=5;">
    <option>aaa
    <option>bbb
    <option>ccc
    <option>ddd
    <option>eee
    </select>
    </BODY>
      

  4.   

    嘿嘿,emu你做的我看过了,好像还是我的最符合要求哦。
    他要求的是利用程序下拉,不定在什么时候下拉,我的方法可以随时调用那个函数,而你的方法限制就比较大了。 :)