项目吃紧,特100分求修改一段代码,基本样式都已经有了(支持手工输入的下拉框). 把你的E-mail给我,我有写好的代码,htc的,你要的功能都有,不用复制多份! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 顶 ..... 给我一个行吗[email protected] Init函数修改如下:function Init(){CoolSelect[0]=["ConTainer1","txt1","select1"];CoolSelect[1]=["ConTainer2","txt2","select2"];CoolSelect[2]=["ConTainer3","txt3","select3"];CoolSelect[3]=["ConTainer4","txt4","select4"];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.offsetWidthsetPosition(i)}----------------------------其他javascript代码不变,就不再赘述。页面内容为-------<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 colspan=4>示例</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" width=100 cellspacing=0 cellpadding=0> <tr> <td><input name="txt2" 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> <td> <table id="Container3" class="selectBox" border="0" width=100 cellspacing=0 cellpadding=0> <tr> <td><input name="txt3" value=" 请选择 " class="editBox" onblur="BoxBlur(this)" onclick="DropDown(2)" onkeyup="showTip(2)"></td> <td width="1"><span class="dropdownbutton" onmouseover="ButtonOver(this)" onmouseout="ButtonOut(this)" onclick="DropDown(2)">6</span></td> </tr> </table> </td> <td> <table id="Container4" class="selectBox" border="0" width=100 cellspacing=0 cellpadding=0> <tr> <td><input name="txt4" value=" 请选择 " class="editBox" onblur="BoxBlur(this)" onclick="DropDown(3)" onkeyup="showTip(3)"></td> <td width="1"><span class="dropdownbutton" onmouseover="ButtonOver(this)" onmouseout="ButtonOut(this)" onclick="DropDown(3)">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)" title="作者:Andy"> <td>哈哈哈哈哈</td> </tr> <tr onmouseover="MouseOver(this)" onclick="MouseClick(1,this)" title="作者:Andy"> <td>里里里里里</td> </tr> <tr onmouseover="MouseOver(this)" onclick="MouseClick(1,this)" title="作者:Andy"> <td>波波波波波</td> </tr> <tr onmouseover="MouseOver(this)" onclick="MouseClick(1,this)" title="作者:Andy"> <td>特特特特特</td> </tr></table><table id="select3" class="selectContent" cellspacing=0 cellpadding=0> <tr onmouseover="MouseOver(this)" onclick="MouseClick(2,this)" title="作者:Andy"> <td>萨达姆</td> </tr> <tr onmouseover="MouseOver(this)" onclick="MouseClick(2,this)" title="作者:Andy"> <td>布什</td> </tr> <tr onmouseover="MouseOver(this)" onclick="MouseClick(2,this)" title="作者:Andy"> <td>布莱尔</td> </tr> <tr onmouseover="MouseOver(this)" onclick="MouseClick(2,this)" title="作者:Andy"> <td>小犬蠢一狼</td> </tr></table><table id="select4" class="selectContent" cellspacing=0 cellpadding=0> <tr onmouseover="MouseOver(this)" onclick="MouseClick(3,this);GoURL(this)" url="http://expert.csdn.net/expert/forum.asp"> <td>CSDN论坛</td> </tr> <tr onmouseover="MouseOver(this)" onclick="MouseClick(3,this);GoURL(this)" url="http://msdn.microsoft.com/library/"> <td>MSDN参考</td> </tr> <tr onmouseover="MouseOver(this)" onclick="MouseClick(3,this);GoURL(this)" url="http://www.iecn.net"> <td>IECN论坛</td> </tr></table></body> 刚刚才发现,用上面的ANDY的那个不行,我的下拉要覆盖在APPLET之上,它那个不是select做的,不能压在APPLET之上,看来我一定找那种用TEXT和SELECT合起来的那种才行了. 看这个<span><input name="box" style="width:82"><span style="width:18;overflow:hidden"><select onchange="box.value=value" style="width:100;margin-left:-82"><option value="hehe">hehe</option><option value="csdn">csdn</option></select</span></span> [email protected]多谢了:) 阿信真是牛啊,寥寥数行代码,就完全符合了我的要求了.感谢感谢!!!!我常常想,CSDN上象阿信这样的牛人,怎么就能把JS运用的那么炉火纯青了,常常看他们的JS代码,很多的东东都是从来没看到过的.我也看过几本JS什么"从入门到精通啊",什么"精通"啊之类的书,可是在他们的代码中出现的那些对象或属性,我真的是在那些书上从没看到过.真的很想很想听听阿信能谈谈自己的学习过程啊,佩服!!!! 又到周末了!问个问题就下班。 4个文本框多条件组合查询? html页面中通过javascript可以获取session值吗? 关于错误信息提示的问题 如何实现自动添加各种元素功能? vbs如何调用其他贞的js数组? 把web上的一个表格或者图片删除,除了用table.removeNode(false)还有其他方法吗??不能用hidden 求救!100分,onBlur 控制焦点的问题!! 【求助】js函数接收数组问题 一个关于节点遍历的问题 判断并提示设置首页的问题 怎么使javascript函数在5秒钟以后运行?
function Init(){
CoolSelect[0]=["ConTainer1","txt1","select1"];
CoolSelect[1]=["ConTainer2","txt2","select2"];
CoolSelect[2]=["ConTainer3","txt3","select3"];
CoolSelect[3]=["ConTainer4","txt4","select4"];
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)
}
----------------------------
其他javascript代码不变,就不再赘述。页面内容为
-------
<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 colspan=4>示例</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" width=100 cellspacing=0 cellpadding=0>
<tr>
<td><input name="txt2" 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>
<td>
<table id="Container3" class="selectBox" border="0" width=100 cellspacing=0 cellpadding=0>
<tr>
<td><input name="txt3" value=" 请选择 " class="editBox" onblur="BoxBlur(this)" onclick="DropDown(2)" onkeyup="showTip(2)"></td>
<td width="1"><span class="dropdownbutton" onmouseover="ButtonOver(this)" onmouseout="ButtonOut(this)" onclick="DropDown(2)">6</span></td>
</tr>
</table>
</td>
<td>
<table id="Container4" class="selectBox" border="0" width=100 cellspacing=0 cellpadding=0>
<tr>
<td><input name="txt4" value=" 请选择 " class="editBox" onblur="BoxBlur(this)" onclick="DropDown(3)" onkeyup="showTip(3)"></td>
<td width="1"><span class="dropdownbutton" onmouseover="ButtonOver(this)" onmouseout="ButtonOut(this)" onclick="DropDown(3)">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)" title="作者:Andy">
<td>哈哈哈哈哈</td>
</tr>
<tr onmouseover="MouseOver(this)" onclick="MouseClick(1,this)" title="作者:Andy">
<td>里里里里里</td>
</tr>
<tr onmouseover="MouseOver(this)" onclick="MouseClick(1,this)" title="作者:Andy">
<td>波波波波波</td>
</tr>
<tr onmouseover="MouseOver(this)" onclick="MouseClick(1,this)" title="作者:Andy">
<td>特特特特特</td>
</tr>
</table>
<table id="select3" class="selectContent" cellspacing=0 cellpadding=0>
<tr onmouseover="MouseOver(this)" onclick="MouseClick(2,this)" title="作者:Andy">
<td>萨达姆</td>
</tr>
<tr onmouseover="MouseOver(this)" onclick="MouseClick(2,this)" title="作者:Andy">
<td>布什</td>
</tr>
<tr onmouseover="MouseOver(this)" onclick="MouseClick(2,this)" title="作者:Andy">
<td>布莱尔</td>
</tr>
<tr onmouseover="MouseOver(this)" onclick="MouseClick(2,this)" title="作者:Andy">
<td>小犬蠢一狼</td>
</tr>
</table>
<table id="select4" class="selectContent" cellspacing=0 cellpadding=0>
<tr onmouseover="MouseOver(this)" onclick="MouseClick(3,this);GoURL(this)" url="http://expert.csdn.net/expert/forum.asp">
<td>CSDN论坛</td>
</tr>
<tr onmouseover="MouseOver(this)" onclick="MouseClick(3,this);GoURL(this)" url="http://msdn.microsoft.com/library/">
<td>MSDN参考</td>
</tr>
<tr onmouseover="MouseOver(this)" onclick="MouseClick(3,this);GoURL(this)" url="http://www.iecn.net">
<td>IECN论坛</td>
</tr>
</table>
</body>
<span>
<input name="box" style="width:82"><span style="width:18;overflow:hidden">
<select onchange="box.value=value" style="width:100;margin-left:-82">
<option value="hehe">hehe</option>
<option value="csdn">csdn</option>
</select</span>
</span>
多谢了:)