-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathexample.html
More file actions
30 lines (25 loc) · 857 Bytes
/
example.html
File metadata and controls
30 lines (25 loc) · 857 Bytes
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
<html>
<body>
<p>Preloading</p>
<script src="build/build.js"></script>
<script>
var p = document.querySelector('p');
var Preloader = require('preloader');
var imgs = new Preloader;
imgs.add('http://mousebreath.com/wp-content/uploads/2011/08/maru__02.jpg');
imgs.add('http://www.weruletheinternet.com/wp-content/uploads/images/2011/june/maru_the_cat/maru_the_cat_4.jpg');
imgs.add('http://lovemeow.com/wp-content/uploads/2010/05/DSC_0959_20100420083642.jpg');
imgs.on('progress', function(e){
p.textContent = e.percent + '%';
});
imgs.end(function(){
p.textContent = 'complete';
imgs.urls.forEach(function(url){
var img = new Image;
img.src = url;
document.body.appendChild(img);
})
})
</script>
</body>
</html>