站 内 搜 索
热门特效推荐

  您当前位置:中国素材首页 >> 网页特效 >> 滚动条 >> 滚动条的设置
 
滚动条的设置
中国素材网 www.sucai86.com 2005-5-12 11:50:27 流量数:

滚动条的设置
[查看演示]  源码如下
----------------------------------------------------------------------------------------
脚本说明:
把如下代码加入<body>区域中
<SCRIPT language=JavaScript1.2>
var des=new Array()
des[0]="<style>\nbody {scrollbar-3dlight-color:red}\n</style>"
des[1]="<style>\nbody {scrollbar-arrow-color:red}\n</style>"
des[2]="<style>\nbody {scrollbar-base-color:red}\n</style>"
des[3]="<style>\nbody {scrollbar-darkshadow-color:red}\n</style>"
des[4]="<style>\nbody {scrollbar-face-color:red}\n</style>"
des[5]="<style>\nbody {scrollbar-highlight-color:red}\n</style>"
des[6]="<style>\nbody {scrollbar-shadow-color:red}\n</style>"
des[7]="<style>\nbody {scrollbar-track-color:red}\n</style>"

function showdetail(cur,c,which){
if (c==1&&document.all){
cur.style.color="red"
cur.style.cursor="hand"
}
else if (document.all){
cur.style.color=""
}
if (which==20&&document.all){
document.scroll.scroll2.value=''
document.body.style.cssText=""
}
else{
document.scroll.scroll2.value=des[which]
if (document.all){
if (which==0)
document.body.style.cssText="scrollbar-3dlight-color='red'"
else if (which==1)
document.body.style.cssText="scrollbar-arrow-color='red'"
else if (which==2)
document.body.style.cssText="scrollbar-base-color='red'"
else if (which==3)
document.body.style.cssText="scrollbar-darkshadow-color='red'"
else if (which==4)
document.body.style.cssText="scrollbar-face-color='red'"
else if (which==5)
document.body.style.cssText="scrollbar-highlight-color='red'"
else if (which==6)
document.body.style.cssText="scrollbar-shadow-color='red'"
else if (which==7)
document.body.style.cssText="scrollbar-track-color='red'"
}
}

}

function test(){
if (document.all)
document.body.style.cssText="scrollbar-face-color:#DFFFBF;scrollbar-shadow-color:green"
}

</SCRIPT>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
              <TR>
          <TD width="100%">
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD width="40%"><FONT face=Arial size=2><SPAN
                  onmouseover=showdetail(this,1,0)
                  onmouseout=showdetail(this,0,20)>1)
                  scrollbar-3dlight-color</SPAN><BR>2) <SPAN
                  onmouseover=showdetail(this,1,1)
                  onmouseout=showdetail(this,0,20)>scrollbar-arrow-color</SPAN><BR>3)
                  <SPAN onmouseover=showdetail(this,1,2)
                  onmouseout=showdetail(this,0,20)>scrollbar-base-color</SPAN><BR>4)
                  <SPAN onmouseover=showdetail(this,1,3)
                  onmouseout=showdetail(this,0,20)>scrollbar-darkshadow-color</SPAN><BR>5)
                  <SPAN onmouseover=showdetail(this,1,4)
                  onmouseout=showdetail(this,0,20)>scrollbar-face-color</SPAN><BR>6)
                  <SPAN onmouseover=showdetail(this,1,5)
                  onmouseout=showdetail(this,0,20)>scrollbar-highlight-color</SPAN><BR>7)
                  <SPAN onmouseover=showdetail(this,1,6)
                  onmouseout=showdetail(this,0,20)>scrollbar-shadow-color</SPAN><BR>8)
                  <SPAN onmouseover=showdetail(this,1,7)
                  onmouseout=showdetail(this,0,20)>scrollbar-track-color</SPAN>
                  </FONT></TD>
                <TD vAlign=center align=left width="100%">
                  <FORM name=scroll action=--WEBBOT-SELF-- method=post>
                  <P><TEXTAREA name=scroll2 rows=5 wrap=virtual cols=39></TEXTAREA></P></FORM></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
                 <P><INPUT onclick=test() type=button value="测试一下吧" name=B3></P>
    

----------------------------------------------------------------------------------------
欢迎来到中国素材网!