弹出选择颜色对话框 - 博客频道 - CSDN.NET
lucky star的专栏
Good good study,day day up!
分类:前端
&html xmlns=&http://www.w3.org/1999/xhtml& &
&title&标题页&/title&
&script language=&javascript&&
function getColor(color)
var sInitColor =
//获取参数传递的颜色
if (sInitColor == null||sInitColor==&&)
var sColor = myColor.ChooseColorDlg();
//打开颜色对话框
var sColor = myColor.ChooseColorDlg(sInitColor);//设置颜色
sColor = sColor.toString(16);
//转换为16进制颜色
if (sColor.length & 6) {
//如果颜色小于6位
var sTempString = &000000&.substring(0,6-sColor.length);//格式化为6位
sColor = sTempString.concat(sColor);
sColor = & + sC
//添加颜色标签
&input type=text name=&txt1& value=&这里显示最终调用的颜色&&
&input type=button value=&选取颜色& onClick=&txt1.value=getColor()&&
&OBJECT id=myColor CLASSID=&clsid:b5-11cf-bb82-00aa00bdce0b& width=&0px& height=&0px&&&/OBJECT&
排名:第4311名
(1)(89)(65)(5)(7)(6)(2)(39)(33)(2)(2)(2)(1)(1)(1)(1)(6)(1)(1)(2)(1)(2)(14)(21)(3)(6)(1)(2)(1)(1)(6)(2)(1)(1)(6)(2)(1)(1)(1)(2)(6)(4)(1)(6)