-
Notifications
You must be signed in to change notification settings - Fork 5
/
test.html
46 lines (43 loc) · 1.12 KB
/
test.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
36
37
38
39
40
41
42
43
44
45
46
<html>
<head>
<title>clipboard-dom test</title>
<script src="build/build.js"></script>
<style type="text/css">
button.hover {
color: red;
}
button.active {
color: blue;
}
</style>
</head>
<body>
<div style="position: relative;">
<button id="button">Copy to Clipboard</button>
</div>
<script type="text/javascript">
var Clip = require('clipboard-dom').swf('ZeroClipboard.swf');
var button = document.getElementById('button');
var clip = new Clip(button, button.parentNode);
clip.text('hello world!');
clip.on('load', function () {
console.log('loaded');
});
clip.on('complete', function (text) {
console.log('copied!', text);
});
clip.on('mouseover', function () {
console.log('mouseover');
});
clip.on('mouseout', function () {
console.log('mouseout');
});
clip.on('mousedown', function () {
console.log('mousedown');
});
clip.on('mouseup', function () {
console.log('mouseup');
});
</script>
</body>
</html>