-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
89 lines (79 loc) · 2.07 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
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!DOCTYPE html>
<html lang="ja">
<meta charset="UTF-8">
<title>jq.typewrite</title>
</html>
<body>
<h1>jq.typewrite</h1>
<h2>basic typewrite</h2>
<pre>var typewrite1 = $.typewrite($('#typewrite1'));
$('#do_typewrite1').click(function() {
typewrite1.play();
});</pre>
<p id="typewrite1">This is typewrite</p>
<p>
<input type="button" id="do_typewrite1" value="Do typewrite 1">
</p>
<h2>with options and using deferred</h2>
<pre>var typewrite2 = $.typewrite($('#typewrite2'), {
duration: 2,
hide: false,
end: '|'
});
$('#do_typewrite2').click(function() {
typewrite2.play().done(function() {
alert('completed');
});
});</pre>
<p id="typewrite2">This is typewrite<br>
This is typewrite</p>
<p>
<input type="button" id="do_typewrite2" value="Do typewrite 2">
</p>
<h2>Using adding wait</h2>
<pre>var typewrite3 = $.typewrite($('#typewrite3'));
$('#do_typewrite3').click(function() {
typewrite3.play(4);
});</pre>
<p id="typewrite3">句点、読点。があると少し待ちます。<br>
ビックリマークがあっても少し待ちます!待ってるよね?たぶん。</p>
<p>
<input type="button" id="do_typewrite3" value="Do typewrite 3">
</p>
<h2>Using as a plugin</h2>
<pre></pre>
<p id="typewrite4">Using as a jQuery plugin</p>
<p>
<input type="button" id="do_typewrite4" value="Do typewrite 4">
</p>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="scripts/jq.typewrite.js"></script>
<script>
// setup
var typewrite1 = $.typewrite($('#typewrite1'));
var typewrite2 = $.typewrite($('#typewrite2'), {
duration: 2,
hide: false,
end: '|'
});
var typewrite3 = $.typewrite($('#typewrite3'));
var typewrite4 = $('#typewrite4').typewrite({
end: '|'
});
$('#do_typewrite1').click(function() {
typewrite1.play();
});
$('#do_typewrite2').click(function() {
typewrite2.play().done(function() {
alert('completed');
});
});
$('#do_typewrite3').click(function() {
typewrite3.play(4);
});
$('#do_typewrite4').click(function() {
typewrite4.typewritePlay(2);
});
</script>
</body>
</html>