首頁| 新聞| 娛樂| 游戲| 科普| 文學(xué)| 編程| 系統(tǒng)| 數(shù)據(jù)庫| 建站| 學(xué)院| 產(chǎn)品| 網(wǎng)管| 維修| 辦公| 熱點
利用js做的一個網(wǎng)頁安全色調(diào)色板 希望大家用得上!
<html><head><meta http-equiv="content-type" content="text/html; charset=gb2311"><title>dw調(diào)色板</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 "><div id="colorpanel" style="position: absolute;"> </div></body></html>
練就火眼金睛 十一種常見電腦
打印機共享提示“操作無法完成
如何查找有故障的配件
回眸一笑百魅生,六宮粉黛無顏色
歲月靜美,剪一影煙雨江南
蕪湖有個“松鼠小鎮(zhèn)”
小滿:小得盈滿,一切剛剛好!
一串串晶瑩剔透的葡萄,像一顆顆寶石掛在藤
正宗老北京脆皮烤鴨
人逢知己千杯少,喝酒搞笑圖集
搞笑試卷,學(xué)生惡搞答題
新聞熱點
疑難解答
圖片精選
Dreamweaver問題集錦大全
Dreamweaver CS3 的最新功能
Dreamweaver CS3代碼片斷功能面板
Dreamweaver技巧:運用代碼片斷工具
網(wǎng)友關(guān)注