茄子在线看片免费人成视频,午夜福利精品a在线观看,国产高清自产拍在线观看,久久综合久久狠狠综合

    <s id="ddbnn"></s>
  • <sub id="ddbnn"><ol id="ddbnn"></ol></sub>

  • <legend id="ddbnn"></legend><s id="ddbnn"></s>

    JS實(shí)現(xiàn)的網(wǎng)頁(yè)上的顏色拾色器
    來(lái)源:易賢網(wǎng) 閱讀:1029 次 日期:2016-07-08 14:16:13
    溫馨提示:易賢網(wǎng)小編為您整理了“JS實(shí)現(xiàn)的網(wǎng)頁(yè)上的顏色拾色器”,方便廣大網(wǎng)友查閱!

    這篇文章主要介紹了JS實(shí)現(xiàn)網(wǎng)頁(yè)上的顏色拾色器,需要的朋友可以參考下

    使用Js代碼編寫(xiě)一個(gè)網(wǎng)頁(yè)上用的顏色拾色器,也就是選擇顏色用的,用鼠標(biāo)單擊任意顏色塊,將彈出顏色值,當(dāng)你想使用某種顏色而不知道顏色值的時(shí)候,用這個(gè)小特效可以告訴你顏色值是多少,比較方便。

    代碼如下:

    <html>

    <head>

    <title>顏色拾色器</title>

    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">

    <style type="text/css">

    <!--

    .style1 {color: #FFFFFF}

    -->

    </style>

    </head>

    <body style="font:menu">

    <span class="style1"></span>

    <table border="0" cellspacing="1" cellpadding="3" width="350" align="center" bgcolor="#dddddd">

    <tr bgcolor="#FFFFFF"> 

    <td width="10%" align="center"> 

    <select name="select1" onchange="selectmenu(this.value)">

    <option value="1" selected>紅</option>

    <option value="2">綠</option>

    <option value="3">藍(lán)</option>

    <option value="4">灰</option>

    </select>

    </td>

    <td width="90%" align="center"> 

    <table width="100%" border="0" cellspacing="0" cellpadding="0">

    <tr> 

    <td align="center" style="font-size:12px">用鼠標(biāo)單擊下面的顏色塊,將彈出顏色值</td>

    </tr>

    </table>

    </td>

    </tr>

    <tr bgcolor="#FFFFFF"> 

    <td width="10%" align="center"> 

      <table id="table1" border="0" cellspacing="1" cellpadding="0">

    <script language="JavaScript">

    for(i=0;i<=15;++i){

     document.write('<tr><td align="center" style="font:menu">'+ishex(i*17) +'</td><td id="Ltd' + i +'" bgcolor="rgb('+ (i*17) + ',0,0)" width="15" height="15" onclick="changeright(this.num)"></td></tr>')

     document.all['Ltd' + i].num=i

    }

    function ishex(which){

        return which.toString(16);

    }

    </script>

    </table></td>

    <td width="90%" align="center"> 

    <table id="table2" border="0" cellspacing="1" cellpadding="0">

    <script language="JavaScript">

    document.write('<tr><td></td>')

    for(i=0;i<=15;++i){

     document.write('<td align="center" style="font:menu; ">'+ishex(i*17)+'</td>');

    }

    document.write('</tr>')

    for(i=0;i<=15;++i){

     document.write('<tr>')

     document.write('<td align="center" style="font:menu;">'+ishex(i*17)+'</td>')

      for(j=0;j<=15;++j){

        document.write('<td id="Rtd'+i+'and'+j+'" style="font:menu;" bgcolor="rgb(0,'+(i*17)+','+(j*17)+')" width="15" height="15" onclick="clickright(this)"></td>');

     }

      document.write('</tr>')

    }

    </script>

    </table>

    </td>

    </tr>

    </table>

    <script language="JavaScript">

    function selectmenu(which){

     switch(which){

      case '1' :leftR();break;

         case '2' :leftG();break;

         case '3' :leftB();break;

         case '4' :leftA();break;

       }

    }

    function leftR(){

     for(i=0;i<=15;++i){

         document.all['Ltd'+i].bgColor='rgb('+(i*17)+',0,0)';

        }

      rightR(0)

    }

    function leftG(){

     for(i=0;i<=15;++i){

         document.all['Ltd'+i].bgColor='rgb(0,'+ (i*17) + ',0)';

     }

      rightG(0)

    }

    function leftB(){

     for(i=0;i<=15;++i){

         document.all['Ltd'+i].bgColor='rgb(0,0,'+(i*17)+')';

     }

      rightB(0)

    }

    function leftA(){

     for(i=0;i<=15;++i){

         document.all['Ltd'+i].bgColor='rgb('+(i*17)+','+(i*17)+','+(i*17)+')';

     }

      rightA()

    }

    function rightR(which){

     for(i=0;i<=15;++i){

         for(j=0;j<=15;++j){

           document.all['Rtd'+i+'and'+j].bgColor='rgb('+(which*17)+','+(i*17)+','+(j*17)+')';

      }

        }

    }

    function rightG(which){

     for(i=0;i<=15;++i){

      for(j=0;j<=15;++j){

       document.all['Rtd'+i+'and'+j].bgColor='rgb('+(i*17)+','+(which*17)+','+(j*17)+')';

      }

        }

    }

    function rightB(which){

     for(i=0;i<=15;++i){

      for(j=0;j<=15;++j){

       document.all['Rtd'+ i+'and'+j].bgColor='rgb('+(i*17)+','+(j*17)+','+(which*17)+')';

       }

        }

    }

    function rightA(){

     for(i=0;i<=15;++i){

      for(j=0;j<=15;++j){

       document.all['Rtd'+i+'and'+j].bgColor='rgb('+(i*16+j)+','+(i*16+j)+','+(i*16+j)+')';

      }

        }

    }

    function clickright(which){

     alert(which.bgColor)

    }

    function changeright(which){

     switch(select1.value){

      case '1' :rightR(which);break;

         case '2' :rightG(which);break;

         case '3' :rightB(which);break;

      }

    }

    </script>

    </body>

    </html>

    更多信息請(qǐng)查看網(wǎng)絡(luò)編程
    易賢網(wǎng)手機(jī)網(wǎng)站地址:JS實(shí)現(xiàn)的網(wǎng)頁(yè)上的顏色拾色器
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門(mén)公布的正式信息和咨詢?yōu)闇?zhǔn)!

    2026上岸·考公考編培訓(xùn)報(bào)班

    • 報(bào)班類(lèi)型
    • 姓名
    • 手機(jī)號(hào)
    • 驗(yàn)證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡(jiǎn)要咨詢 | 簡(jiǎn)要咨詢須知 | 新媒體/短視頻平臺(tái) | 手機(jī)站點(diǎn) | 投訴建議
    工業(yè)和信息化部備案號(hào):滇ICP備2023014141號(hào)-1 云南省教育廳備案號(hào):云教ICP備0901021 滇公網(wǎng)安備53010202001879號(hào) 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號(hào)
    云南網(wǎng)警備案專(zhuān)用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號(hào):hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報(bào)警專(zhuān)用圖標(biāo)