-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample57.htm
More file actions
executable file
·47 lines (39 loc) · 1.17 KB
/
example57.htm
File metadata and controls
executable file
·47 lines (39 loc) · 1.17 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><head><title>Plug-in JavaScript: Example 57</title>
<script src="PJ.js"></script>
<script>Initialize()</script>
</head><body>
<div id='sea'></div>
<img id='ship' src='ship.png' />
<span id='note'><font size='5'>Press any key</font></span>
<script>
window.onload = function()
{
width = GetWindowWidth()
height = GetWindowHeight()
x = width - 200
y = height - 150
mid = width / 2 - 100
Locate('sea', ABS, 0, height - 50)
Resize('sea', width, 50)
S(document.body).backgroundColor = '#b7d4dc'
S('sea').backgroundColor = '#90a5a6'
Locate('ship', ABS, 0, y)
Locate('note', ABS,0, y + 115)
CenterX('note')
Opacity('note', 0)
While("KEY_PRESS != ' '",
Array(
"FadeIn('ship', 500, 0)",
InsVars("Slide('ship', 0, #1, #2, #1, 2500,0)", y, mid),
"FadeIn('note', 1000, 0)",
"WaitKey()",
"FadeOut('note', 1000, 0)",
InsVars("Slide('ship', #1, #2, #3, #2, 2500,0)", mid, y, x),
"FadeOut('ship', 500, 0)",
InsVars("ChainThis('GoTo(\"ship\", 0, #1)')", y)
)
)
}
</script>