-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
75 lines (68 loc) · 2.32 KB
/
demo.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>MarqueeJS DEMO</title>
<!-- Include the marquee css and js -->
<link rel="stylesheet" type="text/css" href="style/marquee.css"/>
<script src="js/marquee.js"></script>
<!-- Style and script specific to the demo -->
<style>
body { font-family: Tahoma, sans-serif; }
a { text-decoration: none; color: gray; }
#content { margin: 50px 125px; width: 600px; }
#wrapper, #input-text { width: 200px; }
#wrapper {
height: 1em;
border-style: solid;
border-width: 1px;
padding: 2px;
}
</style>
<script type="text/javascript">
var isMarqueeEnabled = false;
function updateMarquee() {
if (!Marquee)
return;
if (isMarqueeEnabled)
Marquee.deactivate();
var wrapperNode = document.getElementById('wrapper');
var text = document.getElementById('input-text').value;
var behavior = document.getElementById('behavior').value;
var timingfunc = document.getElementById('timingfunc').value;
Marquee.setup(text, wrapperNode);
Marquee.activate(behavior, timingfunc);
isMarqueeEnabled = true;
}
</script>
</head>
<body>
<a href="https://github.com/mcirlanaru/marquee.js"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_left_darkblue_121621.png" alt="Fork me on GitHub"></a>
<div id="content">
<h1>MarqueeJS</h1>
<p>A simple, light-weight JavaScript and CSS implementation of the <em>marquee</em>.</p>
<p>Source code available on GitHub, developed by <a href="http://www.mihai-cirlanaru.com" target="_blank">Mihai Cîrlănaru</a>.</p>
<hr/>
<h3>DEMO</h3>
<p>
Timing function:
<select id="timingfunc">
<option value="linear" selected>linear</option>
<option value="ease">ease</option>
</select>
<br/>
Behavior:
<select id="behavior">
<option value="scroll" selected>scroll</option>
<option value="alternate">alternate</option>
</select>
</p>
<textarea id="input-text" rows="3" cols="80" autofocus>Enter some text for the marquee here...</textarea>
<br/>
<button type="button" onclick="updateMarquee()">Update marquee</button>
<p>RESULT:</p>
<!-- The marquee is set in the following container -->
<div id="wrapper"></div>
</div>
</body>
</html>