网站首页
关于深山
客户案例
业务范围
联系深山
网络投票系统
企业网站建设
旅行社网站建设
小程序
留言板
技术文章
许愿墙(qq爱墙)
技术首页
百度小程序开发
微信小程序开发
微信公众号开发
uni-app
asp函数库
ASP
asp.net
DIV+CSS
HTML
SEO搜索引擎忧化
下载类信息
个人空间
代码生成
电商
python
页面特效
表格特效
导航菜单
图形特效
表单特效
时间日期
色彩类别
链接特效
网页特效
系统硬件
网站公告
网页学习
技术类文章
网站类信息
订阅本栏目 RSS
您所在的位置:
深山工作室
>
色彩类别
> 正文
利用JAVAscript实现表格渐变
站长站 2008/7/7 21:57:12 深山行者 字体:
大
中
小
浏览 8283
以下为详细代码
利用JAVAscript实现表格渐变 <script language="JavaScript1.2"> <!-- /* Gradient Bar Script (By Alex Szorkovszky alex@wmresources.com) Permission granted to Dynamicdrive.com to feature script in archive For full source code and installation instructions to this script, visit <img src=/moi/file.gif align=absbottom> <a href="http://dynamicdrive.com" target=_blank>http://dynamicdrive.com</a> */ 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 = 350; 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>
前一页:
绝对超酷的JS颜色板
后一页:
一个利用radio单选选择框进行变色的网页效果
相关阅读
支持IE与firefox(火狐)的css写省略号方法
网页制作中注意应用HTML标签的问题
在网页上禁止鼠标右键的方法(1)
网页调用msn/qq/email记录,淘宝,skype挂在网页上
uni-app开发的微信小程序在线支付
下载微信小程序
绵阳市康辉国际旅行社有限责任公司
手机网站
更多信息>>
栏目类别选择
百度小程序开发
微信小程序开发
微信公众号开发
uni-app
asp函数库
ASP
DIV+CSS
HTML
python
更多>>
同类信息
非常不错的支持各种浏览器的简易调色板
背景调色板:状态栏还能显示颜色值
手动调节背景色:背景色能用按钮进行手动调节
页面文字变色、变大、还原
windows颜色选择框
超级酷的滚动条颜色代码生成器
更多>>
最新添加文章
dw里面查找替换使用正则删除sqlserver里面的CONSTRAINT
Android移动端自动化测试:使用UIAutomatorViewer与Selenium定位元素
抖音直播音挂载小雪花 懂车帝小程序
javascript获取浏览器指纹可以用来做投票
火狐Mozilla Firefox出现:无法载入您的Firefox配置文件 它可能已经丢失 或是无法访问 问题解决集合处理办法
在Android、iOS、Windows、MacOS中微信小程序的文件存放路径
python通过代码修改pip下载源让下载库飞起
python里面requests.post返回的res.text还有其它的吗
更多>>
随机抽取信息
文本框禁止方式
珍惜每一个你遇到过的人 放开你心灵之约的视频
旅行社管理系统商业版3.0发布
Dreamweaver错误:以下翻译器没有被装载,由于错误;xsltransform.htm;有不正确的设置信息
radio单选按钮组选择详细
网站首页head区代码规范
更多标签
热门标签
动态
em
注册
应用
缩小
指向
word-spacing
跳转
企业
div的高度
倒计时
代码
获得
选择符
Google
像素
设为首页
时钟
参数
繁体
定位
加长
营销
CSS滤镜
字体
增高
考试
DW
美化
人生
网站地图
flash 透明
下划线
清除
javascri
变幻
Dreamweaver
半透明
个人
ico
查询
搜索引擎
缩略图
Word
柱状图
显示
破解
叛断
在线
height
免责声明:本站所有资料信息,有部分为本人原创,部分为从网络收集而来,仅供网友查看阅读所用,所有信息版权归信息所有人或所有公司所有
如果信息内容侵犯到您的版权或权益请与我们联系,经确认后我们会立即移除相关内容或链接
Copyright © 2007-2026
深山工作室
All Rights Reserved
服务QQ:
565449214
手机:
13961347334
ICP备案:
苏ICP备15019627号
苏公网安备 32070502010230号