我的一亩三分地 我就喜欢!
网站首页
网管
论坛
环境保护
方便网址
网管助手
软件
下载
网站地图
设为主页
收藏本站
当前位置: >
一亩三分地:首页
>
网络学院
>
网页设计
>
JS特效
>
彩色渐变带
上下滚动的文字
(10-21)
状态栏字母大小写转换
(10-21)
网页中播放音乐的实现方法代码
(11-24)
Javascript:window对象的方法
(11-24)
如何防止被IE工具拦截导致无法弹出窗
(11-24)
模仿QQ和MSN消息提示的效果
(11-13)
可展开的导航菜单
(10-21)
下拉式导航菜单
(10-21)
简单实用的下拉菜单
(10-21)
主页制作器
(10-21)
彩色渐变带
作者:
来源:
点击:
日期:
2006-10-21
彩色渐变带
下面为效果显示
脚本说明: 把如下代码加入<body>区域中 <script language="JavaScript1.2"> <!-- if (document.all){ one=new Array(); two=new Array(); var a=10;var b=11;var c=12;var d=13;var e=14;var f=15; //configure gradient //width and height of gradient var width = 250; var height = 20; //no of pixels between colours var gap = 5; //0 for horizontal, 1 for vertical var direction = 0; //colour number 1 - enter 1st, 3rd and 5th numbers/letters of colour code one[0]=f; one[1]=f; one[2]=0; //colour number 2 - enter 1st, 3rd and 5th numbers/letters of colour code two[0]=0; two[1]=c; two[2]=0; //end configuration if(direction==0) var num = width / gap; if(direction==1) var num = height / gap; color2=new Array(); color1=new Array(); diff=new Array(); for(i=0;i<3;i++) { diff[i] = two[i] - one[i]; diff[i] = diff[i] / num; } for(i=0;i<3;i++){ color1[i] = Math.round(diff[i] * Math.pow(10, 0)); if(color1[i] > diff[i])color1[i] = color1[i] - 1; color2[i] = diff[i] - color1[i]; color2[i] = color2[i] * 15; color2[i] = Math.round(color2[i] * Math.pow(10, 0)); } x=new Array(); two[0]=0; two[1]=0; two[2]=0; document.write('<table border="0" cellpadding="0" cellspacing="0" width="'+width+'" height="'+height+'">'); if(direction==0) document.write('<tr>'); for(i=0;i<=num;i++) { if(direction==1) document.write('<tr>'); document.write('<td bgcolor="#'); for(j=0;j<3;j++) { if(one[j]==a)document.write("a"); if(one[j]==b)document.write("b"); if(one[j]==c)document.write("c"); if(one[j]==d)document.write("d"); if(one[j]==e)document.write("e"); if(one[j]==f)document.write("f"); if(one[j]<10)document.write(one[j]); if(two[j]==a)document.write("a"); if(two[j]==b)document.write("b"); if(two[j]==c)document.write("c"); if(two[j]==d)document.write("d"); if(two[j]==e)document.write("e"); if(two[j]==f)document.write("f"); if(two[j]<10)document.write(two[j]); one[j] = one[j] + color1[j]; two[j] = two[j] + color2[j]; if(two[j]>15) { two[j] = two[j] - 15; one[j]++; } } if(direction==0) document.write('" width="'+gap+'" height="'+height+'"> </td>'); if(direction==1) document.write('" width="'+width+'" height="'+gap+'"> </td></tr>'); } document.write('</table>'); } //--> </script>
【
文章评论
】 【
收藏本文
】 【
推荐好友
】 【
打印本文
】 【
论坛讨论
】
相关文章:
·
变换背景色的页面
·
图片集旋转显示
·
弹出的日期选择
·
飘浮文字跟随鼠标
·
广告文字的显示
·
状态栏全日制时间
文章评论:
(条)
请留名:
匿名评论
点击查看所有评论
网管论坛
责任编辑:
一分
声明:刊登此文章是为了传递更多信息,文章内容仅供参考,转载请注明出处。