-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpush_the_button.html
44 lines (41 loc) · 1.66 KB
/
push_the_button.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
<html>
<head><title>AndrewSchutt.net</title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<script type="text/javascript">
function pushbutton()
{
var clicksound = document.getElementById('click');
var btn_table = document.getElementById('btn_table');
clicksound.play();
btn_table.style.paddingTop = '10px';
btn_table.style.paddingBottom = '0px';
setTimeout(buttonup,100);
}
function buttonup()
{
var btn = document.getElementById('btn_text');
var btn_table = document.getElementById('btn_table');
btn_table.style.paddingTop = '0px';
btn_table.style.paddingBottom = '10px';
btn.innerHTML = "Pushed!";
}
</script>
</head>
<body>
<table width="300" height="300" id="btn_table" style="padding-bottom: 10px; padding-top: 0px;">
<tbody>
<tr>
<td valign="middle" align="center" height="300" style="cursor:pointer; background-image: url(images/button.png); background-repeat:no-repeat;" onclick="pushbutton()">
<table cellpadding="0" cellspacing="0" width="250" height="250"><tbody><tr><td valign="middle" align="center"><span id="btn_text" style="width:250px; word-wrap:break-word; color:#ffffff; text-align:center; font-family: Arial bold, Helvetica, sans serif; font-size:36px"></span></td></tr></tbody></table>
</td></tr>
</tbody></table>
<script type="text/javascript">
var agent = navigator.userAgent;
if ((agent.search('Opera')!=-1) || (agent.search('Firefox')!=-1))
document.write ('<audio src="click.ogg" id="click" preload="auto"></audio>');
else
document.write ('<audio src="click.mp3" type="audio/mpeg" id="click" preload="auto"></audio>');
</script>
<audio src="click.mp3" type="audio/mpeg" id="click" preload="auto"></audio>
</body>
</html>