Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 99 lines (84 sloc) 3.485 kB
bee8568 @silentmatt Support for scrolling within a container.
silentmatt authored
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6 <title>Lazy Load Enabled on Container</title>
7 <meta name="generator" content="Mephisto" />
8 <link href="http://www.appelsiini.net/stylesheets/main2.css" rel="stylesheet" type="text/css" />
9 <link rel="alternate" type="application/atom+xml" href="http://feeds.feedburner.com/tuupola" title="Atom feed" />
10 <style type="text/css">
11 #sidebar {
12 width: 0px;
13 }
14
15 #content {
16 width: 804px;
17 }
18
19 #container {
20 height: 600px;
21 overflow: scroll;
22 }
23 </style>
29ed5ab @tuupola Use new Google Analytics code.
authored
24
25 <script>
26 var _gaq = _gaq || [];
27 _gaq.push(['_setAccount', 'UA-190966-1']);
28 _gaq.push(['_trackPageview']);
29 _gaq.push(['_trackPageLoadTime']);
30
31 (function() {
32 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
33 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
34 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
35 })();
36 </script>
bee8568 @silentmatt Support for scrolling within a container.
silentmatt authored
37 </head>
38
39 <body>
40 <div id="wrap">
41 <div id="header">
42 <p>
43 <h1>Lazy Load</h1><br />
44 <small>Image lazy loader plugin for jQuery.</small>
45 <ul id="nav">
46 <li id="first"><a href="/" class="active">weblog</a></li>
47 <li><a href="/projects" class="last">projects</a></li>
48 <!--
49 <li><a href="/cv" class="last">cv</a></li>
50 -->
51 </ul>
52 </p>
53 </div>
54 <div id="content">
55
56 <h2>Plugin enabled on container</h2>
57 <div class="entry">
58
59 <p>
60 Images below the visible area (the ones lower than container bottom) are not loaded. When scrolling down
273011a @tuupola Use jQuery 1.7.0. Remove timestamping from images. Use data-original …
authored
61 they are loaded when needed. Empty cache and shift-reload to test again. Compare this to page where plugin is
bee8568 @silentmatt Support for scrolling within a container.
silentmatt authored
62 <a href="disabled.html">disabled</a> or same page with <a href="enabled_fadein.html">fadein effect</a>.
63 </p>
64
65 <code>
66 <pre>
67 $("img").lazyload({
273011a @tuupola Use jQuery 1.7.0. Remove timestamping from images. Use data-original …
authored
68 effect : "fadeIn",
bee8568 @silentmatt Support for scrolling within a container.
silentmatt authored
69 container: $("#container")
70 });</pre>
71 </code>
72
73 <div id="container">
715d47c @tuupola Fix wide and container demos.
authored
74 <img src="img/grey.gif" data-original="img/bmw_m1_hood.jpg" width="765" height="574" alt="BMW M1 Hood"><br/>
75 <img src="img/grey.gif" data-original="img/bmw_m1_side.jpg" width="765" height="574" alt="BMW M1 Side"><br/>
76 <img src="img/grey.gif" data-original="img/viper_1.jpg" width="765" height="574" alt="Viper 1"><br/>
77 <img src="img/grey.gif" data-original="img/viper_corner.jpg" width="765" height="574" alt="Viper Corner"><br/>
78 <img src="img/grey.gif" data-original="img/bmw_m3_gt.jpg" width="765" height="574" alt="BMW M3 GT"><br/>
79 <img src="img/grey.gif" data-original="img/corvette_pitstop.jpg" width="765" height="574" alt="Corvette Pitstop"><br/>
bee8568 @silentmatt Support for scrolling within a container.
silentmatt authored
80 </div>
81
82 </div>
83 <div id="sidebar">
84
85 </div>
86
87 <div id="footer">
88 </div>
db4b893 @tuupola Move JavaScript to bottom.
authored
89 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js" type="text/javascript" charset="utf-8"></script>
ee4e29f @tuupola Cache buster.
authored
90 <script src="jquery.lazyload.js?v=4" type="text/javascript" charset="utf-8"></script>
db4b893 @tuupola Move JavaScript to bottom.
authored
91 <script type="text/javascript" charset="utf-8">
92 $(function() {
93 $("img").lazyload({effect : "fadeIn", container: $("#container")});
94 });
95 </script>
bee8568 @silentmatt Support for scrolling within a container.
silentmatt authored
96
97 </body>
98 </html>
Something went wrong with that request. Please try again.