日期:2014-05-18  浏览次数:20489 次

如何在网页中添加颜色控件
在网页中添加颜色控件     就像PS中   选择颜色一样
    在那能找到那样的控件     如何使用
        请高手指点.....

------解决方案--------------------
如下代码经过测试

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN ">
<HTML>

<HEAD>
<TITLE> New Document </TITLE>
<META NAME= "Generator " CONTENT= "EditPlus ">
<META NAME= "Author " CONTENT= " ">
<META NAME= "Keywords " CONTENT= " ">
<META NAME= "Description " CONTENT= " ">
<script type= "text/javascript " language= "javascript ">
var tempColor = "FFFFFF ";
function returnColor(obj)
{
var Hcolor = dlgHelper.ChooseColorDlg(tempColor).toString(16);
var xtext=document.getElementById(obj);
//with(xtext)
//{
xtext.value = ((Hcolor.length <6)? "000000 ".substring(0,6-Hcolor.length): " ") + Hcolor;
xtext.style.backgroundColor = ((Hcolor.length <6)? "000000 ".substring(0,6-Hcolor.length): " ") + Hcolor;
xtext.style.color=((Hcolor.length <6)? "000000 ".substring(0,6-Hcolor.length): " ") + Hcolor;
//}
tempColor = Hcolor;
}
</script>
</HEAD>

<BODY>
<input type= "text " id= "Text0 " runat= "server " readonly= "readOnly " style= "width: 50px;
height: 15px; " onselectstart= "return false; " /> &nbsp; <span style= "position: relative; bottom: -3px; ">
<button style= "width: 18px; height: 18px; border: 1px solid #778899; cursor: hand; " alt= "brush " onclick= "returnColor( 'Text0 '); " > Color </button> <a href= "http://www.dotnetjobs.cn "> DotNetJobs.CN </a> <br/>

<object id= "dlgHelper " classid= "clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b " width= "0px "
height= "0px ">
</object>
</BODY>
</HTML>