你可以设置下拉框的宽度。
style="width:200";
随便设多少,直到你能看到完整的内容。

解决方案 »

  1.   

    xiaotot(傻瓜一号) ,谢谢!能不能帮我简单写一下示例代码
      

  2.   

    给个简单得例子你吧,还有好多功能要自己完善了^_^
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    </HEAD><BODY>
    <DIV ID='detail' style="Z-INDEX:5;visibility:hidden;POSITION:absolute">
    </DIV><SELECT ID="sel_test" style="Z-INDEX:-6;width=50" onMouseOver='MOver()' onMouseMove='MOver()' onMouseOut="MOut()">
    <OPTION>first</OPTION>
    <OPTION>second</OPTION>
    <OPTION>third</OPTION>
    </SELECT></BODY>
    </HTML>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function MOver() {
    detail.innerHTML = "<LABEL style='BACKGROUND-COLOR: aquamarine'>this is a test for first!</LABEL>";
    detail.style.top = 20;
    detail.style.left = 70;
    detail.style.visibility = "visible";
    }
    function MOut() {
    detail.innerHTML = "";
    detail.style.visibility = "hidden";
    }
    //-->
    </SCRIPT>
      

  3.   

    还是没有起到作用,我把second改成了secondskhfdskfhsdkfhdskf,右边的没有显示
      

  4.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    </HEAD><BODY>
    <DIV ID='detail' style="Z-INDEX:5;visibility:hidden;POSITION:absolute">
    </DIV><SELECT  ID="sel_test" style="Z-INDEX:-6;width=50" onMouseOver='MOver()' onMouseMove='MOver()' onMouseOut="MOut()">
    <OPTION>first</OPTION>
    <OPTION>second</OPTION>
    <OPTION>third</OPTION>
    </SELECT>
    </BODY>
    </HTML>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function MOver() {
    var st_html = ""; st_html = "<LABEL style='BACKGROUND-COLOR: aquamarine'>this is a test for "; if( sel_test.selectedIndex ==0 ){
    st_html += "first";
    } else if( sel_test.selectedIndex == 1 ) {
    st_html += "second";
    } else if( sel_test.selectedIndex == 2 ) {
    st_html += "third";
    }
    st_html += "!</LABEL>"; detail.innerHTML = st_html;

    detail.style.top = 20;
    detail.style.left = 70;
    detail.style.visibility = "visible";
    }
    function MOut() {
    detail.innerHTML = "";
    detail.style.visibility = "hidden";
    }
    //-->
    </SCRIPT>
      

  5.   

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title></title>
    </head>
    <body><select onmouseout="hideTitle()" style="width:100" onmousemove="showTitle()">
    <option>aaaaaaaaaaaaaaaaaaaaaaaaaaa</option>
    <option>bbbbbbbbbbbbbbbbbbbbbbbbbbb</option>
    <option>ccccccccccccccccccccccccccc</option>
    </select>
    <select onmouseout="hideTitle()" style="width:100" onmousemove="showTitle()">
    <option>111111111111111111111111</option>
    <option>22222222222222222222222</option>
    <option>33333333333333333333333333</option>
    </select><span style="display:none;position:absolute;background-color=#F8F9DF;" id=titleSpan></span>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function showTitle()
    {
    var elm = event.srcElement;
    titleSpan.innerText = elm.options[elm.selectedIndex].text;
    titleSpan.style.top=event.y+20
    titleSpan.style.left=event.x+20
    titleSpan.style.display="";
    }
    function hideTitle()
    {
    titleSpan.style.display="none";
    }
    //-->
    </SCRIPT>
    </body>
    </html>
      

  6.   

    既然放在layer中就已经不再需要option了,用layer模拟option就可以了,这样每一行都可以在layer中显示完全,还有就是测试的时候不要用aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa这样的字符串,这样的字符串会被认为是一个单词,不会换行的。
      

  7.   

    把分给我了,呵呵~~<table border="0" cellspacing="0" cellpadding="0">
      <tr> 
        <td><input name=iData size=10 style="border:1px solid #000000;border-right-width:0px;height:20;background-color:#ff6600"></td>
        <td><input type=button onclick=showSel(true) value="6"  style="border:1px solid #000000;border-left-width:0px;cursor:hand;font-family:Webdings;width:20;height:20;vertical-align:baseline;padding:1px;line-height:5px"></td>
      </tr>
      <tr>
        <td colspan="2"><select id=qswh size=10 style="background-color:#ff6600;position:absolute;display:none" onchange=selText(iData)>
            <option value="32432">1</option>
            <option>12 </option>
            <option>123 </option>
            <option>1234 </option>
            <option>12345 </option>
            <option>123456 </option>
            <option>1234567 </option>
            <option>12345678 </option>
            <option>123456789 </option>
            <option>1234567890 </option>
            <option>12345678909 </option>
            <option>123456789098 </option>
            <option>1234567890987 </option>
            <option>12345678909876 </option>
            <option>123456789098765 </option>
            <option>1234567890987654 </option>
            <option>12345678909876543 </option>
            <option>123456789098765432 </option>
            <option>1234567890987654321 </option></select></td>
      </tr>
    </table>
    <script>
    function document.onclick(){
    showSel(false)
    }
    function showSel(flag){
    document.all.qswh.style.display=(flag?"block":"none")
    window.event.cancelBubble=true;
    }
    function selText(obj){
    obj.value=(document.all.qswh.options[document.all.qswh.selectedIndex].text)
    //showSel(false)
    }
    </script>
      

  8.   

    window.event.cancelBubble是什么属性啊