网站首页
关于深山
客户案例
业务范围
联系深山
网络投票系统
企业网站建设
旅行社网站建设
小程序
留言板
技术文章
许愿墙(qq爱墙)
技术首页
百度小程序开发
微信小程序开发
微信公众号开发
uni-app
asp函数库
ASP
asp.net
DIV+CSS
HTML
SEO搜索引擎忧化
下载类信息
个人空间
代码生成
电商
python
页面特效
表格特效
导航菜单
图形特效
表单特效
时间日期
色彩类别
链接特效
网页特效
系统硬件
网站公告
网页学习
技术类文章
网站类信息
订阅本栏目 RSS
您所在的位置:
深山工作室
>
色彩类别
> 正文
利用JAVAscript实现表格渐变
站长站 2008/7/7 21:57:12 深山行者 字体:
大
中
小
浏览 8285
以下为详细代码
利用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单选选择框进行变色的网页效果
相关阅读
ASP FSO的一些方法与拥有的属性
uni-app开发微信小程序使用button的open-type为contact调用微信客服不能用view或者js调用
jquery实现单选按钮radio选中和取消 使用prop()代替attr()
缩写精简不必要的css定义代码来实现控制网页文件大小
Request.ServerVariables在网页中的一些应用集合
我的地盘我做主之留言板模板
javascript根据内容转换为拼音
asp经典正则表达式应用收藏
更多信息>>
栏目类别选择
百度小程序开发
微信小程序开发
微信公众号开发
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还有其它的吗
更多>>
随机抽取信息
网上页面java图片循环滚动特效
uni-app去除点击navigator标签时有背景底色问题
input输入框的一些属性详解
asp中Request.ServerVariables能获取的信息整理总结
微信公众号回复文本消息或用客服接口推送文本消息
cookies
更多标签
热门标签
弹出
input
tab
函数
网页制作
快捷键
深山v1.0旅行社网站管理系统
多选
上一页
height
split
层
多选框
列
布局
深山
比例
base
过期
键盘
expression
动画
技巧
图层
透明
meta
换行
间隔
checkbox
shift
instr
爱国
许愿墙
广告
生成器
mssql
蜘蛛
展示
面板
超出
县
倒计时
position
营销
理想
效果
简易
flash 透明
relative
样式
免责声明:本站所有资料信息,有部分为本人原创,部分为从网络收集而来,仅供网友查看阅读所用,所有信息版权归信息所有人或所有公司所有
如果信息内容侵犯到您的版权或权益请与我们联系,经确认后我们会立即移除相关内容或链接
Copyright © 2007-2026
深山工作室
All Rights Reserved
服务QQ:
565449214
手机:
13961347334
ICP备案:
苏ICP备15019627号
苏公网安备 32070502010230号