javascript调用系统调色板

注意:仅IE下有效果,W3C浏览器无法运行。因为使用的是acx对象,w3c浏览器不支持acx。

+展开
-HTML
<script>
function colorpicker()
 {
    var sColor_tmp,sColor,color_len;
    sColor_tmp=dlgHelper.ChooseColorDlg().toString(16);
    color_len = sColor_tmp.length;
    switch(color_len){
                case 1:
                    sColor = "00000"+sColor_tmp.toString();
                    break;
                case 2:
                    sColor = "0000"+sColor_tmp.toString();
                    break;
                case 3:
                    sColor = "000"+sColor_tmp.toString();
                    break;
                case 4:
                    sColor = "00"+sColor_tmp.toString();
                    break;
                case 5:
                    sColor = "0"+sColor_tmp.toString();
                    break;
                default:
                    sColor = sColor_tmp.toString();
                    break;
            
            }
    color.value='#'+sColor; 
    color.style.backgroundColor='#'+sColor;
}
</script> <style type="text/css">
<!--
body {
 margin-left: 0px;
 margin-top: 0px;
 margin-right: 0px;
 margin-bottom: 0px;
}

-->
</style> 
<OBJECT id=dlgHelper CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" WIDTH="0px" HEIGHT="0px"></OBJECT>

<table width="100%" height="100%">
<tr><td width="100%" height="100%" align="center">
<input type="text" id='color' name="color" value="" onmouseover="colorpicker()"></td>
</tr></table>

加支付宝好友偷能量挖...


原创文章,转载请注明出处:javascript调用系统调色板

评论(0)Web开发网
阅读(276)喜欢(0)JavaScript/Ajax开发技巧