|
急哦。 |
|
|
|
<html>
<head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta name="Author" content="°¢ÐÅ,fason"> <meta name="KeyWords" content="ÏÂÀ­¿ò,ÊäÈë,°¢ÐÅ,fason"> <title>ƯÁÁÏÂÀ­¿ò</title> <style> .selectBox{border:1px solid #993300;height:20px;} .editBox{border:0px;width:100px;cursor:default;width:100%;height:19px;padding-top:2px;margin:1px} .dropdownbutton{font-size:12px;font-family:webdings;color:#CCFF66;height:20px;background-color:#993300;border:1px solid #993300;padding:0 2;margin:1px;cursor:default} .selectContent{position:absolute;border:1px solid #993300;visibility:hidden;z-index:1000;background-color:#FFFFFF} .selectContent tr{height:20px;cursor:default} .selectContent td{font-size:12px;font-family:Vendana;padding:2 3} .OnFocus{color:#FFFFFF;background-color:#993300} </style> <script language="javascript"> var CoolSelect=[] var CurrentTR=null function MouseOver(trObj){ if(!CurrentTR)CurrentTR=trObj CurrentTR.className="" trObj.className="OnFocus" CurrentTR=trObj; } function ButtonOver(BtnObj){ BtnObj.style.backgroundColor='#cc3300' } function ButtonOut(BtnObj){ BtnObj.style.backgroundColor='#993300' } function MouseClick(Index,trObj){ with(GetObj(CoolSelect[Index][1])){ value=trObj.innerText; style.backgroundColor='#993300' style.color='#FFFFFF' focus() } DropDown(Index) } function GoURL(trObj){ var url=trObj.getAttribute("url") if(url&&url!="")window.open(url) } function BoxBlur(InputBox){ with(InputBox.style){backgroundColor="";color=''} } function DropDown(Index){ event.cancelBubble=true ContainerReset(Index) var show=GetObj(CoolSelect[Index][2]).style.visibility=='visible' GetObj(CoolSelect[Index][2]).style.visibility=show?'hidden':'visible' setPosition(Index) } function document::onclick(){ for(i=0;i<CoolSelect.length;i++){ GetObj(CoolSelect[i][2]).style.visibility='hidden' with(GetObj(CoolSelect[i][2]))for(j=0;j<rows.length;j++)rows[j].style.display="" } } function window::onresize(){ for(i=0;i<CoolSelect.length;i++)setPosition(i) } function showTip(Index){ var inputbox=GetObj(CoolSelect[Index][1]) var container=GetObj(CoolSelect[Index][2]) var num=0 container.style.visibility="visible" for(i=0;i<container.rows.length;i++){ if(container.rows[i].cells[0].innerText.indexOf(inputbox.value)!=0)container.rows[i].style.display="none" else {container.rows[i].style.display="";num++} } if(num==0)container.style.visibility='hidden' } function ContainerReset(Index){ var container=GetObj(CoolSelect[Index][2]) for(i=0;i<container.rows.length;i++)container.rows[i].style.display="" if(CurrentTR)CurrentTR.className="" } function setPosition(Index){ var s=GetObj(CoolSelect[Index][0]) var container=GetObj(CoolSelect[Index][2]) var l=s.offsetLeft; var t=s.offsetTop; while(s=s.offsetParent){l+=s.offsetLeft;t+=s.offsetTop} with(container.style){left=l+1;top=t+GetObj(CoolSelect[Index][0]).offsetHeight} } function Init(){ CoolSelect[0]=["ConTainer1","txt1","select1"] CoolSelect[1]=["ConTainer2","txt2","select2"] for(i=0;i<CoolSelect.length;i++){ var s=GetObj(CoolSelect[i][0]) var container=GetObj(CoolSelect[i][2]) container.style.width=s.offsetWidth>container.offsetWidth?s.offsetWidth:container.offsetWidth setPosition(i) } } function GetObj(id){return document.getElementById(id)} </script> </head> <body onload="Init()"> <div align="center"> <table style="width:250;border:2px solid groove;font-size:12px" border=1 cellspacing=0 cellpadding=0> <tr bgcolor="green" style="font-weight:bold;color:#FFFFFF"> <td>ÊäÈ룬Ìáʾ¹¦ÄÜʾÀý</td><td>²Ëµ¥Ìø×ªÊ¾Àý</td> </tr> <tr> <td> <table id="Container1" class="selectBox" border="0" width=100 cellspacing=0 cellpadding=0> <tr> <td><input name="txt1" value=" ÇëÑ¡Ôñ " class="editBox" onblur="BoxBlur(this)" onclick="DropDown(0)" onkeyup="showTip(0)"></td> <td width="1"><span class="dropdownbutton" onmouseover="ButtonOver(this)" onmouseout="ButtonOut(this)" onclick="DropDown(0)">6</span></td> </tr> </table> </td> <td> <table id="Container2" class="selectBox" border="0" cellspacing=0 cellpadding=0> <tr> <td><input name="txt2" readOnly=true value=" ÇëÑ¡Ôñ " class="editBox" onblur="BoxBlur(this)" onclick="DropDown(1)" onkeyup="showTip(1)"></td> <td width="1"><span class="dropdownbutton" onmouseover="ButtonOver(this)" onmouseout="ButtonOut(this)" onclick="DropDown(1)">6</span></td> </tr> </table> </td> </tr> </table> </div> <table id="select1" class="selectContent" cellspacing=0 cellpadding=0> <tr onmouseover="MouseOver(this)" onclick="MouseClick(0,this)" title="×÷Õß:Andy"> <td>Ò»Æð×ß¹ýµÄÈÕ×Ó</td> </tr> <tr onmouseover="MouseOver(this)" onclick="MouseClick(0,this)" title="×÷Õß:Andy"> <td>ÄãÊÇÎÒµÄÎÂÈá</td> </tr> <tr onmouseover="MouseOver(this)" onclick="MouseClick(0,this)" title="×÷Õß:Andy"> <td>ÄãÊÇÎÒµÄÅ®ÈË</td> </tr> </table> <table id="select2" class="selectContent" cellspacing=0 cellpadding=0> <tr onmouseover="MouseOver(this)" onclick="MouseClick(1,this);GoURL(this)" url="http://expert.csdn.net/expert/forum.asp"> <td>CSDNÂÛ̳</td> </tr> <tr onmouseover="MouseOver(this)" onclick="MouseClick(1,this);GoURL(this)" url="http://msdn.microsoft.com/library/"> <td>MSDN²Î¿¼</td> </tr> <tr onmouseover="MouseOver(this)" onclick="MouseClick(1,this);GoURL(this)" url="http://www.iecn.net"> <td>IECNÂÛ̳</td> </tr> </table> </body> </html> |
|
|
http://expert.csdn.net/Expert/topic/2143/2143373.xml?temp=.4593012
|
|
|
你是说ComboBox吧?IE应该没有,用js模拟一下
1000script上找一下,我记得好像有这样的模拟程序:) |
|