-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patha.html
More file actions
51 lines (51 loc) · 1.83 KB
/
a.html
File metadata and controls
51 lines (51 loc) · 1.83 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Parallax</title>
<style type="text/css">
div,img { position: absolute; }
div.a { top: 0px; left: 150px; }
div.b { top: 150px; left: 0px; }
div.c { top: 150px; left: 300px; }
</style>
<!--script src="http://code.jquery.com/jquery-2.0.3.min.js"></script-->
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="Parallax.js"></script>
<script type="text/javascript">
function onmousemove(event)
{
var p = event.data;
var $w = $(window);
var ey = event.pageY - $w.height() / 2;
var ex = event.pageX - $w.width() / 2;
p.move(ex, ey);
}
function start()
{
var p = new Parallax($('body'), 100, 100);
//$(window).mousemove(p, onmousemove); // IE7以前だと動かない
$(document).mousemove(p, onmousemove);
}
$(start);
</script>
</head>
<body>
<h1>A test of Parallax</h1>
<div class="a">
<img src="red.png" alt="red" depth="10"/>
<img src="green.png" alt="green" depth="15"/>
<img src="blue.png" alt="blue" depth="20"/>
</div>
<div class="b">
<img src="blue.png" alt="blue" depth="10"/>
<img src="red.png" alt="red" depth="15"/>
<img src="green.png" alt="green" depth="20"/>
</div>
<div class="c">
<img src="green.png" alt="green" depth="10"/>
<img src="blue.png" alt="blue" depth="15"/>
<img src="red.png" alt="red" depth="20"/>
</div>
</body>
</html>