-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path8_1p_parallax_vertical.html
52 lines (43 loc) · 2.42 KB
/
8_1p_parallax_vertical.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
45
46
47
48
49
50
51
52
<!doctype html>
<html lang="en">
<head>
<title>Parallax vertical</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<style>
img {
width: 10%;
position: absolute;
}
</style>
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
</head>
<body>
<div class="container-fluid" style="background-color:beige;min-height: 1000px">
<img id="b1" src="images/ballon01.png" style="left:15%;top:500px">
<img id="b2" src="images/ballon02.png" style="left:25%;top:550px;">
<img id="b3" src="images/ballon03.png" style="left:35%;top:600px;">
<img id="b4" src="images/ballon04.png" style="left:45%;top:650px;">
<img id="b5" src="images/ballon05.png" style="left:55%;top:700px;">
<img id="b6" src="images/ballon06.png" style="left:65%;top:750px;"> </div>
<div class="container-fluid" style="background-color:darkgrey;min-height: 2000px"></div>
<script>
$(document).ready(function() {
$(window).scroll(function() {
var winh = $(window).height();
var winw = $(window).width();
var scrolled = $(window).scrollTop();
$("#b1").css('top', (500 - scrolled * .15) + 'px');
$("#b2").css('top', (550 - scrolled * .25) + 'px');
$("#b3").css('top', (600 - scrolled * .35) + 'px');
$("#b4").css('top', (650 - scrolled * .45) + 'px');
$("#b5").css('top', (700 - scrolled * .55) + 'px');
$("#b6").css('top', (750 - scrolled * .65) + 'px');
});
});
</script>
</body>
</html>