-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
35 lines (34 loc) · 1.54 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="mlColorPicker.css" type="text/css" media="screen" charset="utf-8" />
<script type="text/javascript" src="lib/jquery/jquery-1.3.2.js"></script>
<script type="text/javascript" src="mlColorPicker.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>mlColorPicker</title>
</head>
<body>
<h1>mlColorPicker Sample Usage</h1>
<div style="padding:10px;clear:both;border:1px solid black;vertical-align:middle;">
<span id="colorPicker1" style="float:left; border:1px solid black; width:20px; height:20px;margin:5px;background-color:white"></span>
<span id="text1" style="">click on the square</span>
</div>
<div id="colorPicker2"style="padding:10px;clear:both;border:1px solid black;vertical-align:middle;">
<span id="colorPicker2Span" style="float:left; border:1px solid black; width:20px; height:20px;margin:5px;"></span>
<span id="text2" style="">click anywhere</span>
</div>
</body>
<script type="text/javascript">
$(function(){
$("#colorPicker1").mlColorPicker({'onChange': function(val){
$("#colorPicker1").css("background-color", "#" + val);
$("#text1").text("#" + val);
}});
$("#colorPicker2").mlColorPicker({'onChange': function(val){
$("#colorPicker2Span").css("background-color", "#" + val);
$("#text2").text("#" + val);
}});
});
</script>
</html>