网页拾色器

<HTML>
 <HEAD id="Head1">
  <title>网页拾色器</title>
  <script language="javascript">
function colorpick(field){
   var rtn = window.showModalDialog

("Default2.aspx","","dialogWidth:225px;dialogHeight:170px;status:no;help:no;scroll

ing=no;scrollbars=no");
   if(rtn!=null)
 field.style.background=rtn;
  return;
   }
  </script>
 </HEAD>
 <body>
  <form id="form1" runat="server">
   <div style="TEXT-ALIGN: center">
    <table cellpadding="0" cellspacing="0"

style="BACKGROUND-IMAGE: url(Images/1111.bmp);
            WIDTH: 464px;
            HEIGHT: 233px">
     <tr>
      <td style="WIDTH: 96px; HEIGHT:

30px">
      </td>
      <td style="WIDTH: 28px; HEIGHT:

30px">
       <asp:TextBox ID="TextBox1"

runat="server" readonly="true" size="3" style="BACKGROUND-COLOR:#000000"
        Width="67px"

Height="13px" onClick="colorpick(this)"></asp:TextBox></td>
      <td style="WIDTH: 114px; HEIGHT:

30px"><FONT face="宋体"></FONT>
      </td>
     </tr>
     <tr>
      <td style="WIDTH: 96px; HEIGHT:

146px">
      </td>
      <td style="WIDTH: 28px; HEIGHT:

146px">
      </td>
      <td style="WIDTH: 114px; HEIGHT:

146px"><FONT face="宋体"></FONT>
      </td>
     </tr>
    </table>
   </div>
  </form>
 </body>
</HTML>

<script language="JavaScript">
<!--
var h = new Array(6)
h[0] = "FF";
h[1] = "CC";
h[2] = "99";
h[3] = "66";
h[4] = "33";
h[5] = "00";
function action(RGB) {
 //alert('您选择的颜色是:#'+RGB);
 parent.window.returnValue="#"+RGB;
 window.close();
}
function Mcell(R, G, B) {
 document.write('<td bgcolor="#' + R + G + B + '">');
 document.write('<a href="#" onClick="action(/'' + (R + G + B) + '/')">');
 document.write('<img border=0 height=12 width=12 /')" alt=/'#'+R+G+B+'/'>');
 document.write('</a>');
 document.write('</td>');
}
function Mtr(R, B) {
 document.write('<tr>');
 for (var i = 0; i < 6; ++i) {
  Mcell(R, h[i], B);
 }
 document.write('</tr>')
}
function Mtable(B) {
 document.write('<table cellpadding=0 cellspacing=0 border=0>');
 for (var i = 0; i < 6; ++i) {
  Mtr(h[i], B);
 }
document.write('</table>');
}
function Mcube() {
 document.write('<table cellpadding=0 cellspacing=0 border=0><tr>');  //
 for (var i = 0; i < 6; ++i) {
   if(i%3==0){
   document.write('<tr>');
   }
  document.write('<td bgcolor="#FFFFFF">');
  Mtable(h[i])
  document.write('</td>');
 }
   if(i%3==0){
   document.write('</tr>');
   }
 document.write('</tr></table>');
}
Mcube()

 -->

 
  </script> 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值