it167.com  设为主页
 收藏本站
 
  资讯:业界动态 | 软件动态 | 人物专栏 | 安全资讯 | 网络生活 | 电子商务 | 小游戏 | 视频 | 美女图片 | 音乐
  网络编程 | 网站运营 | 网页制作 | 图形图象 | 操作系统 | 媒体动画 | 软件教学 | 网络应用 | 邮件系统 | 网络安全 | 认证考试
asp | .net | php | jsp | Sql | java | Dreamweaver | FrontPages | Javascript | css | Coreldraw | photoshop | Flash | Coreldraw
当前位置: > 主页>网页设计>Dreamweaver>JS 216网页安全色调色板 DW 风格
最新新闻

·机会与整合 边缘化互联
·TOM-Skype新增三大本地
·雅虎抢闸邮箱竞赛 网易
·新浪抢攻北京奥运
·洞悉网络口碑的掘金机会
·拆解网络病毒黑金交易
·木马下载器近期出现新变
·《互联网周刊》第17期文
·Web2.0是否催生自吹自擂
·三张宝宝裸照招来MSN封
热门新闻
·Dreamweaver8轻松实现英
·在Dreamweaver中轻松进
·Dreamweaver设计DIV网页
·在DreamWeaver8中编写di
·像表格table一样对层div
·轻松Diy你的网页滚动条
·用Dreamweaver为网页图
·聚焦Dreamweaver MX 200
·DW MX 2004新功能试用:
·DW MX 2004新功能:浏览
推荐新闻
 
 

JS 216网页安全色调色板 DW 风格 

作者:   来源:it167   点击:   日期:2007-01-01

利用JS做的一个网页安全色调色板 希望大家用得上!

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2311">
<title>DW调色板</title>
<script>
var ColorHex=new Array('00','33','66','99','CC','FF')
var SpColorHex=new Array('FF0000','00FF00','0000FF','FFFF00','00FFFF','FF00FF')
var current=null

function intocolor()
{
var colorTable=''
for (i=0;i<2;i++)
 {
  for (j=0;j<6;j++)
   {
    colorTable=colorTable+'<tr height=12>'
    colorTable=colorTable+'<td width=11 style="background-color:#000000">'
   
    if (i==0){
    colorTable=colorTable+'<td width=11 style="background-color:#'+ColorHex[j]+ColorHex[j]+ColorHex[j]+'">'}
    else{
    colorTable=colorTable+'<td width=11 style="background-color:#'+SpColorHex[j]+'">'}

   
    colorTable=colorTable+'<td width=11 style="background-color:#000000">'
    for (k=0;k<3;k++)
     {
       for (l=0;l<6;l++)
       {
        colorTable=colorTable+'<td width=11 style="background-color:#'+ColorHex[k+i*3]+ColorHex[l]+ColorHex[j]+'">'
       }
     }
  }
}
colorTable='<table width=253 border="0" cellspacing="0" cellpadding="0" style="border:1px #000000 solid;border-bottom:none;border-collapse: collapse" bordercolor="000000">'
           +'<tr height=30><td colspan=21 bgcolor=#cccccc>'
           +'<table cellpadding="0" cellspacing="1" border="0" style="border-collapse: collapse">'
           +'<tr><td width="3"><td><input type="text" name="DisColor" size="6" disabled style="border:solid 1px #000000;background-color:#ffff00"></td>'
           +'<td width="3"><td><input type="text" name="HexColor" size="7" style="border:inset 1px;font-family:Arial;" value="#000000"></td></tr></table></td></table>'
           +'<table border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="000000" onmouseover="doOver()" onmouseout="doOut()" onclick="doclick()" style="cursor:hand;">'
           +colorTable+'</table>';         
colorpanel.innerHTML=colorTable
}

function doOver() {
      if ((event.srcElement.tagName=="TD") && (current!=event.srcElement)) {
        if (current!=null){current.style.backgroundColor = current._background}    
        event.srcElement._background = event.srcElement.style.backgroundColor
        DisColor.style.backgroundColor = event.srcElement.style.backgroundColor
        HexColor.value = event.srcElement.style.backgroundColor
        event.srcElement.style.backgroundColor = "white"
        current = event.srcElement
      }
}

function doOut() {

    if (current!=null) current.style.backgroundColor = current._background
}

function doclick(){
if (event.srcElement.tagName=="TD"){
alert("选取颜色: "+event.srcElement._background)
return event.srcElement._background
}
}
</script>
</head>

<body onload="intocolor()">
<div id="colorpanel" style="position: absolute;">
 </div>
</body>
</html>



文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【论坛讨论

   相关文章:
·Dreamweaver MX打造弹出“向导” ·用Dreamweaver制作拖拽效果
·Dreamweaver MX 也要 VSS(二) ·Dreamweaver MX 也要 VSS(三)
·Dreamweaver MX 也要 VSS(四) ·Dreamweaver MX 也要 VSS(五)

   文章评论:(0条)
  
 请留名: 匿名评论   点击查看所有评论 网管论坛
 

  责任编辑:it167  声明:刊登此文章是为了传递更多信息,文章内容仅供参考,转载请注明出处。