|
0
|
1 |
|
|
|
2 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
|
|
3 |
<html> |
|
|
4 |
<head> |
|
|
5 |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> |
|
|
6 |
<title>Basic Features of the ImageLoader Utility</title> |
|
|
7 |
|
|
|
8 |
<style type="text/css"> |
|
|
9 |
/*margin and padding on body element |
|
|
10 |
can introduce errors in determining |
|
|
11 |
element position and are not recommended; |
|
|
12 |
we turn them off as a foundation for YUI |
|
|
13 |
CSS treatments. */ |
|
|
14 |
body { |
|
|
15 |
margin:0; |
|
|
16 |
padding:0; |
|
|
17 |
} |
|
|
18 |
</style> |
|
|
19 |
|
|
|
20 |
<link type="text/css" rel="stylesheet" href="../../build/cssfonts/fonts-min.css" /> |
|
|
21 |
<script type="text/javascript" src="../../build/yui/yui-debug.js"></script> |
|
|
22 |
|
|
|
23 |
<!--there is no custom header content for this example--> |
|
|
24 |
|
|
|
25 |
</head> |
|
|
26 |
|
|
|
27 |
<body class=" yui-skin-sam"> |
|
|
28 |
|
|
|
29 |
<h1>Basic Features of the ImageLoader Utility</h1> |
|
|
30 |
|
|
|
31 |
<div class="exampleIntro"> |
|
|
32 |
<p>Displayed here are the basic abilities of the <a href="http://developer.yahoo.com/yui/imageloader/">ImageLoader Utility</a>. Images are loaded only after triggers are fired or time limits are reached.</p> |
|
|
33 |
|
|
|
34 |
<p>Hover over each image to show its triggers and its time limit. Try tripping the triggers to see the load reactions. Refresh the page to reset the images.</p> |
|
|
35 |
|
|
|
36 |
|
|
|
37 |
</div> |
|
|
38 |
|
|
|
39 |
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== --> |
|
|
40 |
|
|
|
41 |
<style> |
|
|
42 |
|
|
|
43 |
.everything { position:relative; height:420px; } |
|
|
44 |
.everything div { border:1px solid #888; } |
|
|
45 |
.topmain { position:absolute; top:10px; left:120px; height:75px; width:100px; } |
|
|
46 |
.duo1 { position:absolute; top:130px; left:20px; height:67px; width:100px; } |
|
|
47 |
.duo2 { position:absolute; top:130px; left:220px; height:53px; width:100px; } |
|
|
48 |
.png { position:absolute; top:240px; left:140px; height:34px; width:61px; } |
|
|
49 |
.scroll { position:absolute; top:320px; left:120px; height:72px; width:100px; } |
|
|
50 |
|
|
|
51 |
</style> |
|
|
52 |
|
|
|
53 |
|
|
|
54 |
<div class='everything' id='everything'> |
|
|
55 |
<div class='topmain' id='topmain' title='group 1; mouse over image; 2 sec limit'></div> |
|
|
56 |
<div class='duo1' id='duo1' title='group 2; mouse over left image, or click on right image; 4 sec limit'></div> |
|
|
57 |
<div class='duo2' id='duo2' title='group 2; mouse over left image, or click on right image; 4 sec limit'></div> |
|
|
58 |
<div class='png' id='pngimg' title='group 3; no trigger; 5 sec limit'></div> |
|
|
59 |
<div class='scroll' title='group 4; scroll; no time limit'> |
|
|
60 |
<img id='scrollImg' style='visibility:hidden;' /> |
|
|
61 |
</div> |
|
|
62 |
</div> |
|
|
63 |
|
|
|
64 |
|
|
|
65 |
<script> |
|
|
66 |
|
|
|
67 |
YUI({base:"../../build/", timeout: 10000, filter:"debug", logInclude: {imageloader:true, example:true}}).use("imageloader", function(Y) { |
|
|
68 |
|
|
|
69 |
var mainGroup = new Y.ImgLoadGroup({ name: 'group 1', timeLimit: 2 }); |
|
|
70 |
mainGroup.addTrigger('#topmain', 'mouseover'); |
|
|
71 |
mainGroup.registerImage({ domId: 'topmain', bgUrl: 'http://developer.yahoo.com/yui/docs/assets/examples/exampleimages/small/museum.jpg' }); |
|
|
72 |
|
|
|
73 |
var duoGroup = new Y.ImgLoadGroup({ name: 'group 2', timeLimit: 4 }); |
|
|
74 |
duoGroup.addTrigger('#duo1', 'mouseover').addTrigger('#duo2', 'click'); |
|
|
75 |
duoGroup.registerImage({ domId: 'duo1', bgUrl: 'http://developer.yahoo.com/yui/docs/assets/examples/exampleimages/small/uluru.jpg' }); |
|
|
76 |
duoGroup.registerImage({ domId: 'duo2', bgUrl: 'http://developer.yahoo.com/yui/docs/assets/examples/exampleimages/small/katatjuta.jpg' }); |
|
|
77 |
|
|
|
78 |
var pngGroup = new Y.ImgLoadGroup({ name: 'group 3', timeLimit: 5 }); |
|
|
79 |
pngGroup.registerImage({ domId: 'pngimg', bgUrl: 'http://l.yimg.com/a/i/us/nws/weather/gr/47s.png', isPng: true }); |
|
|
80 |
|
|
|
81 |
var scrollGroup = new Y.ImgLoadGroup({ name: 'group 4' }); |
|
|
82 |
scrollGroup.addTrigger(window, 'scroll'); |
|
|
83 |
scrollGroup.registerImage({ domId: 'scrollImg', srcUrl: 'http://developer.yahoo.com/yui/docs/assets/examples/exampleimages/small/morraine.jpg', setVisible: true }); |
|
|
84 |
|
|
|
85 |
}); |
|
|
86 |
|
|
|
87 |
</script> |
|
|
88 |
|
|
|
89 |
<!--END SOURCE CODE FOR EXAMPLE =============================== --> |
|
|
90 |
|
|
|
91 |
</body> |
|
|
92 |
</html> |