-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImageloader.html
More file actions
56 lines (44 loc) · 1.87 KB
/
Copy pathImageloader.html
File metadata and controls
56 lines (44 loc) · 1.87 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
52
53
54
55
56
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css" media="screen">
<!--
BODY { margin: 10px; padding: 0; font: 1em "Trebuchet MS", verdana, arial, sans-serif; font-size: 100%; }
H1 { margin-bottom: 2px; }
DIV#billboard {
border: 1px solid #ccc;
width: 970px;
height: 500px;
overflow: hidden;
}
div#billboard.loading {background: url(images/spinner.gif) no-repeat center center;}
-->
</style>
<script src="Scripts/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
$(function () {
var img = new Image();
$(img).load(function () {
//$(this).css('display', 'none'); // .hide() doesn't work in Safari when the element isn't on the DOM already
$(this).hide();
$('#loader').removeClass('loading').append(this);
$(this).fadeIn();
}).error(function () {
// notify the user that the image could not be loaded
}).attr('src', 'Fireworks/Alsidebestbuy.jpg');
});
//-->
</script>
</head>
<body>
<h1>Image Loading</h1>
<p>This demonstration shows how to pre-load an image in the background while showing a loading screen. It also supports loading the image, then running additional code, such as Ajax requests before finally showing the image.</p>
<p><a href="http://jqueryfordesigners.com/image-loading/">Read the article this demonstration relates to</a></p>
<div id="billboard" class="loading">
</div>
<p><a href="Fireworks/Alsidebestbuy.jpg">More photos...</a></p>
</body>
</html>