<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    顏色選擇器

    <HTML>
    <HEAD>
    <TITLE> 顏色拾取器 </TITLE>
    <style>
    body
    {
    margin:5px;
    background-color:menu;
    }

    fieldset
    {
    padding:3px;
    }

    body,a,table,div,span,td,th,input,select
    {
    font:9pt;
    font-family:Tahoma,Verdana, Arial, Helvetica, sans-serif;
    }
    </style>
    <script language="javascript">
    <!--
    var Size=18;var Palette=new Array();
    var SelectedColor=null;
    function Init216Colors()
    {
    var RGB=new Array("00","33","66","99","cc","ff");
    Palette=new Array();for(r=0;r<6;r++)
    {
    for(g=0;g<6;g++){for(b=0;b<6;b++){Palette[r*36+g*6+b]=new Array("#"+RGB[r]+RGB[g]+RGB[b],"#"+RGB[r]+RGB[g]+RGB[b]);};};};Palette[0][1]="black";Palette[5][1]="blue";Palette[30][1]="lime";Palette[35][1]="cyan";Palette[180][1]="red";Palette[185][1]="magenta";Palette[210][1]="yellow";Palette[215][1]="white";};
    function CreatePalette()
    {
    var objPalette=document.createElement("span");with(objPalette.style){fontSize=0;pixelWidth=Size*16;pixelHeight=Math.ceil(Palette.length/Size)*16;};objPalette.attachEvent("oncontextmenu",function(){return false;});objPalette.attachEvent("ondragstart",function(){return false;});document.getElementById('Palette').insertAdjacentElement("beforeEnd",objPalette);var objColorButton=document.createElement("span");with(objColorButton.style){fontSize=0;pixelWidth=pixelHeight=18;padding="1px";border="1px solid buttonface";backgroundColor="buttonface";};var objColorBox=document.createElement("span");with(objColorBox.style){fontSize=0;pixelWidth=pixelHeight=14;border="1px solid buttonshadow";};for(var i=0;i<Palette.length;i++){objColorButton.onmousemove=function(){DoMouseMove(this)};objColorButton.onmouseout=function(){DoMouseOut(this)};objColorButton.onmousedown=function(){DoMouseDown(this)};objColorButton.onmouseup=function(){DoMouseUp(this)};objColorBox.style.backgroundColor=Palette[i][0];objColorBox.title=Palette[i][1];objColorButton.appendChild(objColorBox);objPalette.appendChild(objColorButton);objColorButton=objColorButton.cloneNode();objColorBox=objColorBox.cloneNode();};};function DoMouseMove(btn){if(btn!=SelectedColor&&event.button==0){UpHover(btn);}else{DownHover(btn);};};function DoMouseOut(btn){if(btn!=SelectedColor){UpOut(btn);}else{DownOut(btn);};};function DoMouseDown(btn){with(btn.style){DownHover(btn);};};function DoMouseUp(btn){if(btn!=SelectedColor){if(SelectedColor!=null)UpOut(SelectedColor);SelectedColor=btn;};OK();};function UpHover(btn){with(btn.style){borderTopColor=borderLeftColor="buttonhighlight";borderBottomColor=borderRightColor="buttonshadow";backgroundColor="buttonface";};};function DownHover(btn){with(btn.style){borderTopColor=borderLeftColor="buttonshadow";borderBottomColor=borderRightColor="buttonhighlight";backgroundColor="buttonface";};};function UpOut(btn){with(btn.style){borderColor=backgroundColor="buttonface";};};function DownOut(btn){with(btn.style){borderTopColor=borderLeftColor="buttonshadow";borderBottomColor=borderRightColor="buttonhighlight";backgroundColor="whitesmoke";};};
    function OK()
    {
    var color=SelectedColor.firstChild.style.backgroundColor;
    window.returnValue=color;
    window.close();
    };
    function Cancel(){window.close();};function OKCustom(){var color=CustomColor.value;if(!CheckColor(color)){alert("顏色值不合法\r\n應(yīng)該類(lèi)似如下形式 #FF8000 ");return;};window.returnValue=color;window.close();};function Clear(){var obj=window.dialogArguments;obj.value="";obj.nextSibling.style.backgroundColor='';window.close();};function Init(){Init216Colors();CreatePalette();};function CheckColor(str){var re=/^#[a-f0-9]{6}$/i;if(re.test(str)){return true;}else{return false;};};
    //-->
    </script>
    </HEAD>
    <BODY OnLoad="Init()" bgcolor=menu>
    <fieldset>
    <legend>216安全色</legend>
    <table align="center" border=0 cellspacing=0 cellpadding=0 style="font-size:12px;" onselectstart="return false;">
    <tr>
    <td align='left' id='Palette'></td>
    </tr>
    </table>
    </fieldset>

    <fieldset>
    <legend>自定義顏色</legend>
    <table width="100%" align="center" border=0 cellspacing=0 cellpadding=0>
    <tr><td align="center"><input id="CustomColor" type="text" size="10" value="" maxlength="7"> <input id="OKCustom" type="button" onClick="OKCustom()" value="確定"></input></td>
    </tr>
    </table>
    </fieldset>
    <table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
    <tr>
    <td align="center"><input type="button" value="清空" style="width:80px" onClick="Clear()"></td>
        <td align="center"><input type="button" value="取消" style="width:80px" onClick="Cancel()"></td>
    </tr>
    </table>

    </BODY>
    </HTML>


    文章來(lái)源:http://www.cnblogs.com/wangdetian168/archive/2008/09/18/1293474.html
    posted on 2010-09-29 13:28 sanmao 閱讀(249) 評(píng)論(0)  編輯  收藏

    只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
     

    常用鏈接

    留言簿(5)

    隨筆分類(lèi)

    隨筆檔案

    搜索

    •  

    最新評(píng)論

    閱讀排行榜

    評(píng)論排行榜

    主站蜘蛛池模板: 一级毛片**不卡免费播| 亚洲欧洲日产专区| 成人免费视频77777| 高清永久免费观看| 日韩国产精品亚洲а∨天堂免| 亚洲一卡2卡三卡4卡有限公司| 免费v片在线观看| 无码视频免费一区二三区| 国产激情免费视频在线观看| 一级做a爱过程免费视频高清| 亚洲熟妇久久精品| 亚洲色图.com| 亚洲国产二区三区久久| 久久亚洲国产成人影院网站 | 亚洲乳大丰满中文字幕| 国产美女无遮挡免费视频| 青青青国产在线观看免费| 久久免费看少妇高潮V片特黄| 一级中文字幕乱码免费| 在线观看亚洲精品专区| 亚洲日韩精品A∨片无码加勒比| 亚洲国产中文在线视频| 亚洲综合综合在线| 亚洲尹人九九大色香蕉网站| 亚洲人成在线播放网站| 伊人婷婷综合缴情亚洲五月| 亚洲人成无码www久久久| 免费A级毛片无码久久版| 国产成人精品免费直播| 免费黄网在线观看| 在线免费视频一区| 成**人免费一级毛片| 国国内清清草原免费视频99| 国产精品爱啪在线线免费观看| 91短视频在线免费观看| 久久w5ww成w人免费| 91精品免费久久久久久久久| www视频在线观看免费| 成年人免费的视频| 野花高清在线观看免费3中文| 国产精品成人免费一区二区|