首页 > 网站 > WEB开发 > 正文

移动边框滚动条后,滚动条会自动变色

2024-04-27 13:57:50
字体:
来源:转载
供稿:网友
<!-- 把下面代码加到<body>区域中 -->
 <script language="javaScript">
<!--
colours=new Array('ff0000','fff000','00ff00','ffa500','ff00ff','00ffff','ffffff')
function Flash(){
var clrPos=Math.floor(Math.random()*colours.length)
 with (window.document.body.style){
 scrollbarTrackColor=document.bgColor;
 scrollbarFaceColor=document.bgColor;
 scrollbarArrowColor=colours[clrPos];
 scrollbar3dLightColor=colours[clrPos]; 
 scrollbarHighlightColor=colours[clrPos];
 scrollbarShadowColor=colours[clrPos];
 scrollbarDarkShadowColor=colours[clrPos];
 borderWidth=5;
 borderStyle='solid';
 borderColor=colours[clrPos];
 }
}
if (document.all)window.document.body.onscroll=flash;
//-->
</script>
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表