<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
.LongSelect{
width: expression((this.offsetWidth>100)?'auto':'100');
}</style>
</head>
<body>
<select class=LongSelect ><option>fdsafdsafdsafdasfdsafdsaf fdsa fdsafdsaf dasfdsafsd</select><br>
<select class=LongSelect ><option>dsafsd</select><br>
<select class=LongSelect ><option></select><br>
<select class=LongSelect ><option>11</select><br></body>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
.LongSelect{
width: expression((this.offsetWidth>100)?'auto':'100');
}</style>
</head>
<body>
<select class=LongSelect ><option>fdsafdsafdsafdasfdsafdsaf fdsa fdsafdsaf dasfdsafsd</select><br>
<select class=LongSelect ><option>dsafsd</select><br>
<select class=LongSelect ><option></select><br>
<select class=LongSelect ><option>11</select><br></body>
大哥,谢谢
不过不是我要的效果!宽度100是固定的,不变化
是下拉的时候显示出来更宽的内容,不被下拉条截断
http://webfx.eae.net/dhtml/combobox/combo_demo.htm
Download:
http://webfx.eae.net/dhtml/combobox/ComboBox.zip
{ overflow-x : auto}
或者脚本里面object.style.overflowX ="auto"
overflow-x : auto在什么时候有效?
不用模拟的就没有办法了吗
<option>11111111111111111111111111
</select>