日期:2014-05-16 浏览次数:20350 次
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>颜色选择器</title>
<style>
body,blockquote {margin:0;padding:0;font-size:12px;font-family:"微软雅黑",Verdana,Arial}
.cp2{
width:100px;
height:100px;
background:#CCC;
margin-top:20px;
margin-left:20px;
float:left;
}
</style>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.colorpicker.js"></script>
</head>
<body>
<div id="container">
<div type="text" class="cp2"></div>
<div type="text" class="cp2"></div>
<div type="text" class="cp2"></div>
</div>
<script type="text/javascript">
$(function(){
$(".cp2").colorpicker({
success:function(o,color){
$(o).css("background-color",color);
}
});
});
</script>
</body>
</html>