鼠标移动到文本框 弹出颜色代码器? 可以参考dojo的DatePicker,。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 JUST FOR IE<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> 好了,我自己解决了,谢谢你哦,我最终要的效果代码如下:<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title><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; } document.form1.color.value='#'+sColor; document.form1.color.style.backgroundColor='#'+sColor;}</script><style type="text/css"><!--body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px;}.border { border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #6AB5FF;}--></style></head><body><OBJECT id=dlgHelper CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" WIDTH="0px" HEIGHT="0px" style="margin-left:200px; margin-left:300px;"></OBJECT><form name="form1" action="" method="post"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"><tr><td height="50"> </td><td height="50"> </td></tr><tr><td align="right"><input name="color" type="text" class="border" id='color' value="#ff80c0" size="10" readonly="readonly"></td><td><input type="button" onclick="colorpicker()" value="选择颜色" /></td></tr><tr><td height="50" colspan="2" align="center"> <label> <input type="submit" name="button" id="button" value="提交" /> </label></td></tr></table></form><div align="center">你选择的颜色是:<% =request.Form("color")%></div></body></html> 论坛图片签名档怎么做 javascript中prototype的问题 js中引用js的后页面调用的路径问题 左侧隐藏菜单在火狐不正常,怎么改? 网页加载和显示顺序问题! js执行应用程序的小问题???? 网页制作 求助 有代码 (在线等) [消息蒲公英 2002]->强力散播 To Javascript 菜鸟提问,大虾帮忙 Firefox下超链接中事件无法触发? 高手帮我看看啊 我写的哪里有问题, 为什么运行脚本呢?
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>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<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;
}
document.form1.color.value='#'+sColor;
document.form1.color.style.backgroundColor='#'+sColor;
}
</script><style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.border {
border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 0px;
border-left-width: 0px;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #6AB5FF;
}
-->
</style>
</head><body>
<OBJECT id=dlgHelper CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" WIDTH="0px" HEIGHT="0px" style="margin-left:200px; margin-left:300px;"></OBJECT>
<form name="form1" action="" method="post">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td height="50"> </td>
<td height="50"> </td>
</tr>
<tr><td align="right">
<input name="color" type="text" class="border" id='color' value="#ff80c0" size="10" readonly="readonly">
</td>
<td><input type="button" onclick="colorpicker()" value="选择颜色" /></td>
</tr>
<tr><td height="50" colspan="2" align="center">
<label>
<input type="submit" name="button" id="button" value="提交" />
</label>
</td>
</tr>
</table></form>
<div align="center">你选择的颜色是:
<% =request.Form("color")
%></div>
</body>
</html>