forked from lopezs/ableplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest14.html
More file actions
86 lines (73 loc) · 2.08 KB
/
test14.html
File metadata and controls
86 lines (73 loc) · 2.08 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Able Player Test #14</title>
<link rel="stylesheet" href="tests.css" type="text/css">
<!-- Dependencies -->
<script src="../thirdparty/modernizr.custom.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="../thirdparty/jquery.cookie.js"></script>
<!-- Able Player CSS -->
<link rel="stylesheet" href="../styles/ableplayer.css" type="text/css"/>
<!-- Able Player JavaScript -->
<script src="../build/ableplayer.js"></script>
</head>
<body>
<h1>Able Player Test #14:<br/>Audio player on a page with form fields</h1>
<p>For additional tests see the <a href="index.html">Index of <em>Able Player</em> Examples</a>.</p>
<!-- use the following markup for each media element -->
<audio id="audio1" preload="auto" data-able-player>
<source type="audio/ogg" src="../media/smallf.ogg"/>
<source type="audio/mpeg" src="../media/smallf.mp3"/>
</audio>
<h2>Form Fields</h2>
<p>When users are interacting with form fields, their keystrokes should not be handled by the player.</p>
<style>
.form label, .form input {
display: block;
margin-bottom: 0.5em;
font-size: 1em;
}
.form label {
font-weight: bold;
}
.form #feedback {
font-weight: bold;
font-size: 1.1em;
color: black;
background-color: #FFC;
padding: 0.5em;
margin: 1em 0;
width: 20em;
text-align: center;
border: thin solid #340449;
display: none;
width:
}
</style>
<script>
(function () {
var feedback, answer;
$(document).ready(function () {
$('#submit').click(function() {
answer = $('#favplayer').val().toLowerCase();
if (answer == 'able player') {
feedback = 'Correct!';
}
else {
feedback = 'Wrong answer! Please try again.';
}
$('#feedback').text(feedback).show();
})
});
})();
</script>
<div class="form">
<div id="feedback" role="alert"></div>
<label for="favplayer">What's your favorite media player?</label>
<input type="text" id="favplayer">
<input type="submit" value="Submit" id="submit">
</div>
</body>
</html>