我每次发消息怎么都没人说话呢?是钱太少了么?

解决方案 »

  1.   

    有个类似的不过是选取颜色的,参考一下
    OCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <!-- saved from url=(0038)http://star.uying.com/test/sample.html -->
    <HTML><HEAD><TITLE>New Document</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=gb2312">
    <META content="MSHTML 6.00.2800.1522" name=GENERATOR>
    <META content="" name=Author>
    <META content="" name=Keywords>
    <META content="" name=Description></HEAD>
    <BODY>
    <SCRIPT language=JavaScript>
    function ColorTable(instance){ this.Instance = new String(instance);
    this.Color = "#000000";
    var flag = -1;
    var PreviewCellID = "ColorPreview_" + (Math.random()*1000000 + 10000).toString().substring(0,5);
    var RGBID = "RGBID_" + (Math.random()*1000000 + 10000).toString().substring(0,5);
    var LayerID = "LAYER_" + (Math.random()*1000000 + 10000).toString().substring(0,5); var Colors = "#000000,#000000,#000000,#000000,#003300,#006600,#009900,#00cc00,#00ff00,#330000,#333300,#336600,#339900,#33cc00,#33ff00,#660000,#663300,#666600,#669900,#66cc00,#66ff00,#000000,#333333,#000000,#000033,#003333,#006633,#009933,#00cc33,#00ff33,#330033,#333333,#336633,#339933,#33cc33,#33ff33,#660033,#663333,#666633,#669933,#66cc33,#66ff33,#000000,#666666,#000000,#000066,#003366,#006666,#009966,#00cc66,#00ff66,#330066,#333366,#336666,#339966,#33cc66,#33ff66,#660066,#663366,#666666,#669966,#66cc66,#66ff66,#000000,#999999,#000000,#000099,#003399,#006699,#009999,#00cc99,#00ff99,#330099,#333399,#336699,#339999,#33cc99,#33ff99,#660099,#663399,#666699,#669999,#66cc99,#66ff99,#000000,#cccccc,#000000,#0000cc,#0033cc,#0066cc,#0099cc,#00cccc,#00ffcc,#3300cc,#3333cc,#3366cc,#3399cc,#33cccc,#33ffcc,#6600cc,#6633cc,#6666cc,#6699cc,#66cccc,#66ffcc,#000000,#ffffff,#000000,#0000ff,#0033ff,#0066ff,#0099ff,#00ccff,#00ffff,#3300ff,#3333ff,#3366ff,#3399ff,#33ccff,#33ffff,#6600ff,#6633ff,#6666ff,#6699ff,#66ccff,#66ffff,#000000,#ff0000,#000000,#990000,#993300,#996600,#999900,#99cc00,#99ff00,#cc0000,#cc3300,#cc6600,#cc9900,#cccc00,#ccff00,#ff0000,#ff3300,#ff6600,#ff9900,#ffcc00,#ffff00,#000000,#00ff00,#000000,#990033,#993333,#996633,#999933,#99cc33,#99ff33,#cc0033,#cc3333,#cc6633,#cc9933,#cccc33,#ccff33,#ff0033,#ff3333,#ff6633,#ff9933,#ffcc33,#ffff33,#000000,#0000ff,#000000,#990066,#993366,#996666,#999966,#99cc66,#99ff66,#cc0066,#cc3366,#cc6666,#cc9966,#cccc66,#ccff66,#ff0066,#ff3366,#ff6666,#ff9966,#ffcc66,#ffff66,#000000,#ffff00,#000000,#990099,#993399,#996699,#999999,#99cc99,#99ff99,#cc0099,#cc3399,#cc6699,#cc9999,#cccc99,#ccff99,#ff0099,#ff3399,#ff6699,#ff9999,#ffcc99,#ffff99,#000000,#00ffff,#000000,#9900cc,#9933cc,#9966cc,#9999cc,#99cccc,#99ffcc,#cc00cc,#cc33cc,#cc66cc,#cc99cc,#cccccc,#ccffcc,#ff00cc,#ff33cc,#ff66cc,#ff99cc,#ffcccc,#ffffcc,#000000,#ff00ff,#000000,#9900ff,#9933ff,#9966ff,#9999ff,#99ccff,#99ffff,#cc00ff,#cc33ff,#cc66ff,#cc99ff,#ccccff,#ccffff,#ff00ff,#ff33ff,#ff66ff,#ff99ff,#ffccff,#ffffff".split(","); this.ShowTable = function(x,y){
    if(flag != 1){
    return;
    }
    document.getElementById(LayerID).style.display = "";
    document.getElementById(LayerID).style.top = parseInt(y,10);
    document.getElementById(LayerID).style.left = parseInt(x,10);
    }

    this.Init = function(){
    if(flag != (-1)){
    return;
    }
    if(window[this.Instance] != this){
    throw new Error(-1,"");
    }
    flag = 0;
    } this.SetColor = function(color){
    if(flag != 1){
    return;
    }
    this.Color = new String(color).toUpperCase(); document.getElementById(PreviewCellID).style.backgroundColor = this.Color;
    document.getElementById(RGBID).innerHTML = this.Color;
    }

    this.Select =  function(color){
    if(flag != 1){
    return;
    }
    this.Color = new String(color).toUpperCase();
    document.getElementById(LayerID).style.display = "none";
    document.getElementById('ColorSel').style.backgroundColor=colorTable.Color;
    } this.Draw = function(){
    if(flag == (-1)){
    this.Init();
    }
    if(flag != 0){
    return ;
    }
    var shtml = "";
    shtml += '<div id="' + LayerID + '" style="position:absolute;display:none;top:0px;left:0px;width:214px;height:145px;overflow:visible;border:0px;z-index:999999;">';
    shtml += this.GetTable();
    shtml += '</div>';

    document.write(shtml);
    flag = 1;
    }

    this.Hide = function(){
    if(flag != 1){
    return;
    }
    document.getElementById(LayerID).style.display = "none";
    } this.GetTable = function(){
    var shtml = '\
    <table width="214" onmousedown="event.cancelBubble=true;" height="145" border="0" cellpadding="0" cellspacing="0" style="border:solid 1px #000000">\n\
    <tr>\n\
    <td height="20" bgcolor="#D4D0C8" scope="col"><table width="100%" style="margin:2px;" border="0" cellspacing="0" cellpadding="0">\n\
    <tr>\n\
    <td width="24%" height="20" style="background-color:#ffffff;border:solid 1px #000000" scope="col" id="' + PreviewCellID + '">&nbsp;</td>\n\
    <td width="43%" height="20" scope="col"><div align="center" style="font-family:宋体;font-size:9pt;" id="' + RGBID + '"></div></td>\n\
    <td width="33%" height="20" scope="col"><div align="center"></div></td>\n\
    </tr>\n\
    </table></td>\n\
    </tr>\n\
    <tr>\n\
    <td>'; shtml += '<table border="0" cellspacing="1" bgcolor="#000000">';
    shtml += '<tr height="10">';
    for(var i=0,l=Colors.length;i<l;i++){
    if(i%21 == 0){
    shtml += "</tr><tr>";
    }
    shtml += '<td height="10" width="10" bgcolor="' + Colors[i] + '" style="cursor:hand;" onmouseover="' + this.Instance + '.SetColor(bgColor)" onmousedown="' + this.Instance + '.Select(bgColor)"></td>';
    }
    shtml += '</table>';
    shtml += ' </td>\n\
    </tr>\n\
    </table>';
    return shtml;
    }
    }
    var colorTable = new ColorTable("colorTable");
    colorTable.Draw();
    document.onmousedown = function(){
    colorTable.Hide();
    //alert(colorTable.Color);
    }
    </SCRIPT>
    <input value="Hello Word" name=TXT></input>
    <table width="50"  height="30" border="0" cellpadding="0" cellspacing="0" style="border:solid 1px #000000">
    <tr>
    <td id=ColorSel height="20" bgcolor="#D4D0C8" scope="col" onclick="colorTable.ShowTable(event.x,event.y);">
    </td>
    </tr>
    </table>
    <input type="button"
     type=button value="Select Color"> </BODY></HTML>