怎样才能让form 的select的滚动条变色??急!!! http://www.blueidea.com/bbs/NewsDetail.asp?id=251048http://www.blueidea.com/bbs/NewsDetail.asp?id=263438 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 但是我隐藏不了select的滚动条呀。请看http://www.student.buct.edu.cn/colleges/2002huagong/index.htm其左下角有个select.其颜色有点不协调。像改掉。 <STYLE type="text/css">BODY {scrollbar-base-color: lightblue;}</STYLE><script>str="";mywidth=0;lastobj=null;function showdiv(w,h){ document.all.mysel.style.display="none"; str="<input type=text style='width:"+w+";border:1 solid #000000;' readOnly onclick=showlist() value="+document.all.mysel.options[document.all.mysel.selectedIndex].text+">";if(document.all.mysel.size!="") liststr="<table style='border:0' width="+(w-20)+" cellspacing=0 cellpadding=0>";else liststr="<table style='border:1 solid #000000;' width="+w+" cellspacing=0 cellpadding=0>"; for(i=0;i<document.all.mysel.options.length;i++) liststr+="<tr><td style='font-size:10pt' onmouseover=myover() onmouseout=myout() onclick=myclick("+i+")>"+document.all.mysel.options[i].text+"</td></tr>"; liststr+="</table>";if(document.all.mysel.size!="") { likesel.style.width=w-20; likesel.style.height=h; likesel.style.borderLeft="1 solid #000000"; if(document.all.mysel.size>=document.all.mysel.options.length) likesel.style.borderRight="1 solid #000000"; likesel.style.borderTop="1 solid #000000"; likesel.style.borderBottom="1 solid #000000"; likesel.innerHTML=liststr; } else likesel.innerHTML=str; mywidth=w;}function showlist(){ likesel.innerHTML+=liststr;}function myover(){event.srcElement.style.cursor="default";if(document.all.mysel.size!="") return; event.srcElement.style.color="white"; event.srcElement.style.background="darkblue";}function myout(){if(document.all.mysel.size!="") return; event.srcElement.style.color=""; event.srcElement.style.background="";}function myclick(j){ document.all.mysel.selectedIndex=j;if(document.all.mysel.size!="") { if(lastobj!=null) { lastobj.style.color=""; lastobj.style.background=""; } event.srcElement.style.cursor="default"; event.srcElement.style.color="white"; event.srcElement.style.background="darkblue"; lastobj=event.srcElement; } else { str="<input type=text style='width:"+mywidth+";border:1 solid #000000;' readOnly onclick=showlist() value="+document.all.mysel.options[document.all.mysel.selectedIndex].text+">"; likesel.innerHTML=str; }}</script><body onload="showdiv(mysel.offsetWidth,mysel.offsetHeight)"><select name=mysel size=4><option value=11 selected>1111111<option value=12>111112<option value=13>1111111113<option value=14>45465113<option value=15>888888888113<option value=16>1000</select><div id=likesel style="overflow-y:auto"><div> to seabell(百合心)你坏!:) 有关JS显示本列相同字符的问题 求助!!DHTMLX GRID 怎样下载\安装\使用JSlint编写js代码? js document.cookie值存放在哪里? js 弹窗 奇怪的问题?? 在QZONE里,拖动挂件时,鼠标放上挂件的时,有一个层出来,怎么样做的 怎么上传头像 如图 怎么禁止文字或按钮在打印时显示 动态创建树节点 ExtJS4 求一正则表达式 怎样才能让form 的select的滚动条变色? 有错误怎么继续执行下去?
请看http://www.student.buct.edu.cn/colleges/2002huagong/index.htm
其左下角有个select.其颜色有点不协调。像改掉。
BODY {
scrollbar-base-color: lightblue;
}
</STYLE>
<script>
str="";
mywidth=0;
lastobj=null;
function showdiv(w,h)
{
document.all.mysel.style.display="none";
str="<input type=text style='width:"+w+";border:1 solid #000000;' readOnly onclick=showlist() value="+document.all.mysel.options[document.all.mysel.selectedIndex].text+">";
if(document.all.mysel.size!="")
liststr="<table style='border:0' width="+(w-20)+" cellspacing=0 cellpadding=0>";
else
liststr="<table style='border:1 solid #000000;' width="+w+" cellspacing=0 cellpadding=0>";
for(i=0;i<document.all.mysel.options.length;i++)
liststr+="<tr><td style='font-size:10pt' onmouseover=myover() onmouseout=myout() onclick=myclick("+i+")>"+document.all.mysel.options[i].text+"</td></tr>";
liststr+="</table>";
if(document.all.mysel.size!="")
{
likesel.style.width=w-20;
likesel.style.height=h;
likesel.style.borderLeft="1 solid #000000";
if(document.all.mysel.size>=document.all.mysel.options.length)
likesel.style.borderRight="1 solid #000000";
likesel.style.borderTop="1 solid #000000";
likesel.style.borderBottom="1 solid #000000";
likesel.innerHTML=liststr;
}
else
likesel.innerHTML=str;
mywidth=w;
}function showlist()
{
likesel.innerHTML+=liststr;
}
function myover()
{
event.srcElement.style.cursor="default";
if(document.all.mysel.size!="")
return;
event.srcElement.style.color="white";
event.srcElement.style.background="darkblue";
}
function myout()
{
if(document.all.mysel.size!="")
return;
event.srcElement.style.color="";
event.srcElement.style.background="";
}
function myclick(j)
{
document.all.mysel.selectedIndex=j;
if(document.all.mysel.size!="")
{
if(lastobj!=null)
{
lastobj.style.color="";
lastobj.style.background="";
}
event.srcElement.style.cursor="default";
event.srcElement.style.color="white";
event.srcElement.style.background="darkblue";
lastobj=event.srcElement;
}
else
{
str="<input type=text style='width:"+mywidth+";border:1 solid #000000;' readOnly onclick=showlist() value="+document.all.mysel.options[document.all.mysel.selectedIndex].text+">";
likesel.innerHTML=str;
}
}
</script>
<body onload="showdiv(mysel.offsetWidth,mysel.offsetHeight)">
<select name=mysel size=4>
<option value=11 selected>1111111
<option value=12>111112
<option value=13>1111111113
<option value=14>45465113
<option value=15>888888888113
<option value=16>1000
</select>
<div id=likesel style="overflow-y:auto"><div>
:)