本页主题: 求一可编select源代码 打印 | 加为IE收藏 | 复制链接 | 收藏主题 | 上一主题 | 下一主题

还有一快钱
级别: 武林新秀


精华: 0
发帖: 77
威望: 83 点
财富: 908 K币
贡献值: 0 点
注册时间:2005-08-17
最后登录:2008-01-16

 求一可编select源代码

系统提示:这是一个从旧版社区导入的帖子。
如果显示不正常,或需要查找旧帖中上传的附件,请参照原帖。
原帖地址:http://my.iecn.net/bbs/view/107329.html
如非必要,请不要修改此帖!如果修改,请保留以上信息。
如题,或能解决以下问题的也行:
<select name="test" style="width:10px">
<option>testtesttesttesttesttest</option>
  <option>aaaaaaaaaaaaaaaaaa</option>
</select>
当用户单击下拉按钮时能自适应显示<option>的内容
感谢!!!
顶端 Posted: 2007-04-04 15:50 | [楼 主]
还有一快钱
级别: 武林新秀


精华: 0
发帖: 77
威望: 83 点
财富: 908 K币
贡献值: 0 点
注册时间:2005-08-17
最后登录:2008-01-16

 

原本想用这个来摸似,可第一次单击的时候,下拉列表就立即回收了,要再单击一次才行。
<script>
function change(id,selfObj){
var obj = document.getElementById(id);
if(!obj)return;
obj.style.visibility = 'hidden';
obj.style.width='1px';
obj.style.height='1px';
selfObj.style.width = '220px';
selfObj.style.left = obj.style.left;
selfObj.style.top = obj.style.top;
}
</script>
<input type="text" id="test" name="test" value="" style="width:200px">
<select name="test1" style="width:20px" onclick="change('test',this);">
<option>1111111111111111111</option>
<option>1111111111111111111</option>
<option>1111111111111111111</option>
<option>1111111111111111111</option>
</select>
枫岩,能帮我改改么?

系统提示:这是一个从旧版导入的帖子,如有问题请参照原帖(原帖地址见顶楼)。

顶端 Posted: 2007-04-05 09:34 | 1 楼
枫岩
我在想念 心已累倦
级别: 总版主


精华: 12
发帖: 25380
威望: 21612 点
财富: 4565 K币
贡献值: 3 点
注册时间:2003-12-28
最后登录:2008-09-24

 

以下是引用内容:

最初由 还有一快钱 发表

原本想用这个来摸似,可第一次单击的时候,下拉列表就立即回收了,要再单击一次才行。
<script>
function change(id,selfObj){
var obj = document.getElementById(id);
if(!obj)return;
obj.style.visibility = 'hidden';
obj.style.width='1px';
obj.style.height='1px';
selfObj.style.width = '220px';
selfObj.style.left = obj.style.left;
selfObj.style.top = obj.style.top;
}
</script>
<input type="text" id="test" name="test" value="" style="width:200px">
<select name="test1" style="width:20px" onclick="change('test',this);">
<option>1111111111111111111</option>
<option>1111111111111111111</option>
<option>1111111111111111111</option>
<option>1111111111111111111</option>
</select>
枫岩,能帮我改改么?


呵呵,没看明白你要实现的是什么样的效果

系统提示:这是一个从旧版导入的帖子,如有问题请参照原帖(原帖地址见顶楼)。

顶端 Posted: 2007-04-06 00:07 | 2 楼
枫岩
我在想念 心已累倦
级别: 总版主


精华: 12
发帖: 25380
威望: 21612 点
财富: 4565 K币
贡献值: 3 点
注册时间:2003-12-28
最后登录:2008-09-24

 

你要的是不是这个效果?
HTML 代码:


因为其它除了iframe外的HTML元素无法盖住select的。
你可以把那个文本输入框放到iframe页面中去,当用户在里面输入完后,把需要传的值写到父页中就行了。

系统提示:这是一个从旧版导入的帖子,如有问题请参照原帖(原帖地址见顶楼)。

顶端 Posted: 2007-04-06 00:26 | 3 楼
帖子浏览记录 版块浏览记录
IECN社区 » XHTML/CSS/Dreamweaver

Time now is:11-20 19:44, Gzip disabled 京ICP备06069722号
Powered by PHPWind v6.3.2 Certificate Code © 2003-08 PHPWind.com Corporation