网站首页
关于深山
客户案例
业务范围
联系深山
网络投票系统
企业网站建设
旅行社网站建设
小程序
留言板
技术文章
许愿墙(qq爱墙)
技术首页
百度小程序开发
微信小程序开发
微信公众号开发
uni-app
asp函数库
ASP
asp.net
DIV+CSS
HTML
SEO搜索引擎忧化
下载类信息
个人空间
代码生成
电商
python
页面特效
表格特效
导航菜单
图形特效
表单特效
时间日期
色彩类别
链接特效
网页特效
系统硬件
网站公告
网页学习
技术类文章
网站类信息
订阅本栏目 RSS
您所在的位置:
深山工作室
>
色彩类别
> 正文
利用JAVAscript实现表格渐变
站长站 2008/7/7 21:57:12 深山行者 字体:
大
中
小
浏览 8284
以下为详细代码
利用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单选选择框进行变色的网页效果
相关阅读
uni-app基础知识事件传参(动态参数演示)
python自动控制鼠标操作pymouse
改善用户体验之checkbox表单(最多可以选择三个)
连云港党建
微信小程序直播组件live-player-plugin(wx2b03c6e691cd7370)
深山留言板V2.1 Build 090620
刘浏家俱
fiddler抓包在内容的SyntaxView窗口里面是乱码
更多信息>>
栏目类别选择
百度小程序开发
微信小程序开发
微信公众号开发
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还有其它的吗
更多>>
随机抽取信息
阳光丽江客栈
13种样式检测QQ是否在线的代码
javascript实现图片预览功能
模仿as效果的跳动导航菜单
连云港华夏国际旅行社
DIV与Table布局在大型网站的可用性比较
更多标签
热门标签
想
奋斗
png
统计
天气预报
用户体验
Response
简易
自动隐藏
缓冲
定位
右键失效
对联
IE8
复选框
Abandon
iis 安装
checkbox
expression
留言板模版
顶部
特效
ie
选择框
vista
msn
彩色
比例
hidden
常用
下划线
base
调色器
visite
innerText
tag
容器
电影
Java
动画
CAD
断线
单选
闭合
购物
Application
txt
163
web 2.0
position
免责声明:本站所有资料信息,有部分为本人原创,部分为从网络收集而来,仅供网友查看阅读所用,所有信息版权归信息所有人或所有公司所有
如果信息内容侵犯到您的版权或权益请与我们联系,经确认后我们会立即移除相关内容或链接
Copyright © 2007-2026
深山工作室
All Rights Reserved
服务QQ:
565449214
手机:
13961347334
ICP备案:
苏ICP备15019627号
苏公网安备 32070502010230号