您目前尚未登陆,请选择【登陆】或【注册
首页->会员交友->网博直销系统软件源码>>admin/style/selcolor.html>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:网博直销系统软件源码
当前文件:文件类型 WangBoDirect/admin/style/selcolor.html打开代码结构图
普通视图
		            
1<HTML> 2<HEAD> 3<TITLE>Choose Color作者QQ:405098219 4 5联系电话:13518884166 6</TITLE> 7<meta http-equiv="content-type" content="text/html; charset=gb2312"> 8<link rel="stylesheet" type="text/css" href="pop.css"> 9 10<script language="javascript"> 11var SelRGB = '#000000'; 12var DrRGB = ''; 13var SelGRAY = '120'; 14var oColorTable, oGrayTable; 15var oSelColor, oShowColor, oRGB, oGRAY; 16 17var hexch = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'); 18 19function ToHex(n) 20{ var h, l; 21 22 n = Math.round(n); 23 l = n % 16; 24 h = Math.floor((n / 16)) % 16; 25 return (hexch[h] + hexch[l]); 26} 27 28function DoColor(c, l) 29{ 30 var r, g, b; 31 r = '0x' + c.substring(1, 3); 32 g = '0x' + c.substring(3, 5); 33 b = '0x' + c.substring(5, 7); 34 35 if(l > 120) 36 { 37 l = l - 120; 38 39 r = (r * (120 - l) + 255 * l) / 120; 40 g = (g * (120 - l) + 255 * l) / 120; 41 b = (b * (120 - l) + 255 * l) / 120; 42 }else 43 { 44 r = (r * l) / 120; 45 g = (g * l) / 120; 46 b = (b * l) / 120; 47 } 48 49 return '#' + ToHex(r) + ToHex(g) + ToHex(b); 50} 51 52function EndColor() 53{ 54 var i; 55 56 if(DrRGB != SelRGB) 57 { 58 DrRGB = SelRGB; 59 for(i = 0; i <= 30; i ++) 60 oGrayTable.rows[i].bgColor = DoColor(SelRGB, 240 - i * 8); 61 } 62 63 if (document.all){ 64 oSelColor.value = DoColor(oRGB.innerText, oGRAY.innerText); 65 }else{ 66 oSelColor.value = DoColor(oRGB.innerHTML, oGRAY.innerHTML); 67 } 68 oShowColor.bgColor = oSelColor.value; 69} 70 71function CtableClick(evnt) 72{ 73 if (document.all){ 74 SelRGB=event.srcElement.bgColor.toUpperCase(); 75 }else{ 76 SelRGB=evnt.target.bgColor.toUpperCase(); 77 } 78 EndColor(); 79} 80 81function CtableOver(evnt) 82{ 83 //SelRGB = e.srcElement.bgColor; 84 if (document.all){ 85 oRGB.innerText = event.srcElement.bgColor.toUpperCase(); 86 }else{ 87 oRGB.innerHTML = evnt.target.bgColor.toUpperCase(); 88 } 89 EndColor(); 90} 91 92function CtableOut() 93{ 94 if (document.all){ 95 oRGB.innerText = SelRGB; 96 }else{ 97 oRGB.innerHTML = SelRGB; 98 } 99 EndColor(); 100} 101 102function GtableClick(evnt) 103{ 104 if (document.all){ 105 SelGRAY = event.srcElement.title; 106 }else{ 107 SelGRAY = evnt.target.title; 108 } 109 EndColor(); 110} 111 112function GtableOver(evnt) 113{ 114 if(document.all){ 115 oGRAY.innerText = event.srcElement.title; 116 }else{ 117 oGRAY.innerHTML = evnt.target.title; 118 } 119 EndColor(); 120} 121 122function GtableOut() 123{ 124 if (document.all){ 125 oGRAY.innerText = SelGRAY; 126 }else{ 127 oGRAY.innerHTML = SelGRAY; 128 } 129 EndColor(); 130} 131 132function SelColorBlur() 133{ 134 SelRGB = oSelColor.value; 135 if (document.all){ 136 oRGB.innerText = SelRGB; 137 }else{ 138 oRGB.innerHTML = SelRGB; 139 } 140 EndColor(); 141} 142 143function InitDocument() 144{ 145 oSelColor=document.getElementById("SelColor"); 146 oShowColor=document.getElementById("ShowColor"); 147 oRGB=document.getElementById("RGB"); 148 oGRAY=document.getElementById("GRAY"); 149 150 oColorTable = document.getElementById("ColorTable"); 151 oGrayTable = document.getElementById("GrayTable"); 152 153 oColorTable.onclick=CtableClick; 154 oColorTable.onmouseover=CtableOver; 155 oColorTable.onmouseout=CtableOut; 156 oGrayTable.onclick=GtableClick; 157 oGrayTable.onmouseover=GtableOver; 158 oGrayTable.onmouseout=GtableOut; 159 oSelColor.onblur=SelColorBlur; 160} 161 162function ok(){ 163 if (opener){ 164 if (opener.WBTB_ExecuteCommand){ 165 command = new String(launchParameters['commandName']); 166 opener.WBTB_ExecuteCommand(command,'',oSelColor.value); 167 }else if(opener.setColor){ 168 opener.setColor(oSelColor.value); 169 } 170 }else{ 171 window.returnValue = oSelColor.value; 172 } 173 window.close(); 174} 175 176 177</script> 178<!-- 179<script language="javascript" for="ColorTable" event="onclick"> 180 SelRGB = event.srcElement.bgColor; 181 EndColor(); 182</script> 183 184<script language="javascript" for="ColorTable" event="onmouseover"> 185 oRGB.innerText = event.srcElement.bgColor.toUpperCase(); 186 EndColor(); 187</script> 188 189<script language="javascript" for="ColorTable" event="onmouseout"> 190 oRGB.innerText = SelRGB; 191 EndColor(); 192</script> 193 194<script language="javascript" for="GrayTable" event="onclick"> 195 SelGRAY = event.srcElement.title; 196 EndColor(); 197</script> 198 199<script language="javascript" for="GrayTable" event="onmouseover"> 200 oGRAY.innerText = event.srcElement.title; 201 EndColor(); 202</script> 203 204<script language="javascript" for="GrayTable" event="onmouseout"> 205 oGRAY.innerText = SelGRAY; 206 EndColor(); 207</script> 208 209--> 210<script language="javascript" > 211</script> 212 213</head> 214 215<body bgcolor="menu" onload="InitDocument()"> 216 217<div align="center"><center><table border="0" cellspacing="10" cellpadding="0"><tr><td> 218<table ID="ColorTable" border="0" cellspacing="0" cellpadding="0" style='cursor:hand'> 219<script language="javascript"> 220function wc(r, g, b, n) 221{ 222 r = ((r * 16 + r) * 3 * (15 - n) + 0x80 * n) / 15; 223 g = ((g * 16 + g) * 3 * (15 - n) + 0x80 * n) / 15; 224 b = ((b * 16 + b) * 3 * (15 - n) + 0x80 * n) / 15; 225 226 document.write('<td bgcolor=#' + ToHex(r) + ToHex(g) + ToHex(b) + ' height=8 width=8></TD>'); 227} 228 229var cnum = new Array(1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0); 230 231 for(i =