forked from 9elements/loadie.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
33 lines (29 loc) · 960 Bytes
/
index.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Loadie - Example Page</title>
<script src="js/jquery.min.js"></script>
<script src="js/jquery.loadie.js"></script>
<link rel="stylesheet" href="css/loadie.css">
<style>body{margin:0px}</style>
</head>
<body>
<a href="https://github.com/9elements/loadie.js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
<img src="img/1.jpg" class="loaded-image" alt="">
<img src="img/2.jpg" class="loaded-image" alt="">
<img src="img/3.jpg" class="loaded-image" alt="">
<script>
$(function() {
var totalImages = $(".loaded-image").size();
var imagesLoaded = 0;
$('body').loadie();
$(".loaded-image").bind("load", function(){
$(this).show();
imagesLoaded++;
$('body').loadie(imagesLoaded / totalImages);
});
})
</script>
</body>
</html>