- Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patha.html
More file actions
Latest commit
51 lines (51 loc) · 1.83 KB
/
Copy patha.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>
<metacharset="UTF-8"/>
<title>Parallax</title>
<styletype="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-->
<scriptsrc="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<scripttype="text/javascript" src="Parallax.js"></script>
<scripttype="text/javascript">
functiononmousemove(event)
{
varp=event.data;
var$w=$(window);
varey=event.pageY-$w.height()/2;
varex=event.pageX-$w.width()/2;
p.move(ex,ey);
}
functionstart()
{
varp=newParallax($('body'),100,100);
//$(window).mousemove(p, onmousemove); // IE7以前だと動かない
$(document).mousemove(p,onmousemove);
}
$(start);
</script>
</head>
<body>
<h1>A test of Parallax</h1>
<divclass="a">
<imgsrc="red.png" alt="red" depth="10"/>
<imgsrc="green.png" alt="green" depth="15"/>
<imgsrc="blue.png" alt="blue" depth="20"/>
</div>
<divclass="b">
<imgsrc="blue.png" alt="blue" depth="10"/>
<imgsrc="red.png" alt="red" depth="15"/>
<imgsrc="green.png" alt="green" depth="20"/>
</div>
<divclass="c">
<imgsrc="green.png" alt="green" depth="10"/>
<imgsrc="blue.png" alt="blue" depth="15"/>
<imgsrc="red.png" alt="red" depth="20"/>
</div>
</body>
</html>