enabled_container.html 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  5. <title>Lazy Load Enabled on Container</title>
  6. <meta name="generator" content="Mephisto" />
  7. <link href="http://www.appelsiini.net/stylesheets/main2.css" rel="stylesheet" type="text/css" />
  8. <link rel="alternate" type="application/atom+xml" href="http://feeds.feedburner.com/tuupola" title="Atom feed" />
  9. <style type="text/css">
  10. #sidebar {
  11. width: 0px;
  12. }
  13. #content {
  14. width: 804px;
  15. }
  16. #container {
  17. height: 600px;
  18. overflow: scroll;
  19. }
  20. </style>
  21. <script>
  22. var _gaq = _gaq || [];
  23. _gaq.push(['_setAccount', 'UA-190966-1']);
  24. _gaq.push(['_trackPageview']);
  25. _gaq.push(['_trackPageLoadTime']);
  26. (function() {
  27. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  28. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  29. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  30. })();
  31. </script>
  32. </head>
  33. <body>
  34. <div id="wrap">
  35. <div id="header">
  36. <p>
  37. <h1>Lazy Load</h1><br />
  38. <small>Image lazy loader plugin for jQuery.</small>
  39. <ul id="nav">
  40. <li id="first"><a href="/" class="active">weblog</a></li>
  41. <li><a href="/projects" class="last">projects</a></li>
  42. <!--
  43. <li><a href="/cv" class="last">cv</a></li>
  44. -->
  45. </ul>
  46. </p>
  47. </div>
  48. <div id="content">
  49. <h2>Plugin enabled on container</h2>
  50. <div class="entry">
  51. <p>
  52. Images below the visible area (the ones lower than container bottom) are not loaded. When scrolling down
  53. they are loaded when needed. Empty cache and shift-reload to test again. Compare this to page where plugin is
  54. <a href="disabled.html">disabled</a> or same page with <a href="enabled_fadein.html">fadein effect</a>.
  55. </p>
  56. <code>
  57. <pre>
  58. $("img").lazyload({
  59. effect : "fadeIn",
  60. container: $("#container")
  61. });</pre>
  62. </code>
  63. <div id="container">
  64. <img src="img/grey.gif" data-original="img/bmw_m1_hood.jpg" width="765" height="574" alt="BMW M1 Hood"><br/>
  65. <img src="img/grey.gif" data-original="img/bmw_m1_side.jpg" width="765" height="574" alt="BMW M1 Side"><br/>
  66. <img src="img/grey.gif" data-original="img/viper_1.jpg" width="765" height="574" alt="Viper 1"><br/>
  67. <img src="img/grey.gif" data-original="img/viper_corner.jpg" width="765" height="574" alt="Viper Corner"><br/>
  68. <img src="img/grey.gif" data-original="img/bmw_m3_gt.jpg" width="765" height="574" alt="BMW M3 GT"><br/>
  69. <img src="img/grey.gif" data-original="img/corvette_pitstop.jpg" width="765" height="574" alt="Corvette Pitstop"><br/>
  70. </div>
  71. </div>
  72. <div id="sidebar">
  73. </div>
  74. <div id="footer">
  75. </div>
  76. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" charset="utf-8"></script>
  77. <script src="jquery.lazyload.js?v=1.8.3" charset="utf-8"></script>
  78. <script type="text/javascript" charset="utf-8">
  79. $(function() {
  80. $("img").lazyload({effect : "fadeIn", container: $("#container")});
  81. });
  82. </script>
  83. </body>
  84. </html>