-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
example.htm
64 lines (58 loc) · 1.23 KB
/
example.htm
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html>
<head>
<title>jQuery Dice Example</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" src="jquery.dice.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$('#dice').dice({'callback': callback});
});
function callback(num)
{
$('#current_number').html('Current number: '+num);
}
</script>
<style type="text/css">
h1 {
text-align: center;
}
body > div {
width: 340px;
margin-left: auto;
margin-right: auto;
padding: 20px;
}
div#dice {
float: left;
width: 50px;
}
div.l {
float: right;
width: 250px;
}
div.l:after {
clear: both;
}
div#current_number {
margin-top: 15px;
font-weight: bold;
}
</style>
</head>
<body>
<h1>jQuery Dice Example</h1>
<div>
<div id="dice"></div>
<div class="l">
<div>
Really simple demo of a really simple jQuery plugin.
(I think it needn't even to be explained that you
have to click on the dice to dice.)
</div>
<div id="current_number">Current number: none</div>
</div>
</div>
</body>
</html>