JS 216网页安全色调色板 DW 风格
<P>利用JS做的一个网页安全色调色板 希望大家用得上!</P><FIELDSET style="COLOR: #808080" align=center><P><LEGEND align=center></LEGEND><html><BR><head><BR><meta http-equiv="Content-Type" content="text/html; charset=gb2311"><BR><title>DW调色板</title><BR><script><BR>var ColorHex=new Array('00','33','66','99','CC','FF')<BR>var SpColorHex=new Array('FF0000','00FF00','0000FF','FFFF00','00FFFF','FF00FF')<BR>var current=null</P><P>function intocolor()<BR>{<BR>var colorTable=''<BR>for (i=0;i<2;i)<BR> {<BR>for (j=0;j<6;j)<BR> {<BR> colorTable=colorTable '<tr height=12>'<BR> colorTable=colorTable '<td width=11 style="background-color:#000000">'<BR> <BR> if (i==0){<BR> colorTable=colorTable '<td width=11 style="background-color:#' ColorHex ColorHex ColorHex '">'} <BR> else{<BR> colorTable=colorTable '<td width=11 style="background-color:#' SpColorHex '">'} </P><P> <BR> colorTable=colorTable '<td width=11 style="background-color:#000000">'<BR> for (k=0;k<3;k)<BR> {<BR> for (l=0;l<6;l)<BR> {<BR> colorTable=colorTable '<td width=11 style="background-color:#' ColorHex ColorHex ColorHex '">'<BR> }<BR> }<BR>}<BR>}<BR>colorTable='<table width=253 border="0" cellspacing="0" cellpadding="0" style="border:1px #000000 solid;border-bottom:none;border-collapse: collapse" bordercolor="000000">'<BR> '<tr height=30><td colspan=21 bgcolor=#cccccc>'<BR> '<table cellpadding="0" cellspacing="1" border="0" style="border-collapse: collapse">'<BR> '<tr><td width="3"><td><input type="text" name="DisColor" size="6" disabled style="border:solid 1px #000000;background-color:#ffff00"></td>'<BR> '<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>'<BR> '<table border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="000000" onmouseover="doOver()" onmouseout="doOut()" onclick="doclick()" style="cursor:hand;">'<BR> colorTable '</table>'; <BR>colorpanel.innerHTML=colorTable<BR>}</P><P>function doOver() {<BR> if ((event.srcElement.tagName=="TD") && (current!=event.srcElement)) {<BR> if (current!=null){current.style.backgroundColor = current._background} <BR> event.srcElement._background = event.srcElement.style.backgroundColor<BR> DisColor.style.backgroundColor = event.srcElement.style.backgroundColor<BR> HexColor.value = event.srcElement.style.backgroundColor<BR> event.srcElement.style.backgroundColor = "white"<BR> current = event.srcElement<BR> }<BR>}</P><P>function doOut() {</P><P> if (current!=null) current.style.backgroundColor = current._background<BR>}</P><P>function doclick(){<BR>if (event.srcElement.tagName=="TD"){<BR>alert("选取
页:
[1]