enabled_noscript.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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 With Nonscript Fallback</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: 770px;
  15. }
  16. .lazy {
  17. display: none;
  18. }
  19. </style>
  20. <script>
  21. var _gaq = _gaq || [];
  22. _gaq.push(['_setAccount', 'UA-190966-1']);
  23. _gaq.push(['_trackPageview']);
  24. _gaq.push(['_trackPageLoadTime']);
  25. (function() {
  26. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  27. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  28. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  29. })();
  30. </script>
  31. </head>
  32. <body>
  33. <div id="wrap">
  34. <div id="header">
  35. <p>
  36. <h1>Lazy Load</h1><br />
  37. <small>Image lazy loader plugin for jQuery.</small>
  38. <ul id="nav">
  39. <li id="first"><a href="/" class="active">weblog</a></li>
  40. <li><a href="/projects" class="last">projects</a></li>
  41. <!--
  42. <li><a href="/cv" class="last">cv</a></li>
  43. -->
  44. </ul>
  45. </p>
  46. </div>
  47. <div id="content">
  48. <h2>Plugin enabled with nonscript fallback</h2>
  49. <div class="entry">
  50. <p>
  51. This page deprecates gracefully for non JavaScript browsers. It requires hiding
  52. lazy loaded images with css and adding a &lt;noscript&gt; block which contains
  53. the real image and it is shown when JavaScript is not enabled. If JavaScript is enabled
  54. show() function is called before initializing Lazy Load plugin.
  55. </p>
  56. <code><pre>
  57. /* CSS **/
  58. .lazy {
  59. display: none;
  60. }
  61. /* JS */
  62. $("img.lazy").show().lazyload({
  63. effect : "fadeIn"
  64. });
  65. /* HTML */
  66. &lt;img class="lazy" src="img/grey.gif" data-original="img/example.jpg" width="765" height="574"&gt;
  67. &lt;noscript&gt;&lt;img src="img/example.jpg" width="765" height="574"&gt;&lt;/noscript&gt;
  68. </pre>
  69. </code>
  70. <img class="lazy" src="img/grey.gif" data-original="img/bmw_m1_hood.jpg" alt="BMW M1 Hood" width="765" height="574">
  71. <img class="lazy" src="img/grey.gif" data-original="img/bmw_m1_side.jpg" width="765" height="574" alt="BMW M1 Side">
  72. <img class="lazy" src="img/grey.gif" data-original="img/viper_1.jpg" width="765" height="574" alt="Viper 1">
  73. <img class="lazy" src="img/grey.gif" data-original="img/viper_corner.jpg" width="765" height="574" alt="Viper Corner">
  74. <img class="lazy" src="img/grey.gif" data-original="img/bmw_m3_gt.jpg" width="765" height="574" alt="BMW M3 GT">
  75. <img class="lazy" src="img/grey.gif" data-original="img/corvette_pitstop.jpg" width="765" height="574" alt="Corvette Pitstop">
  76. <noscript>
  77. <img src="img/bmw_m1_hood.jpg" width="765" height="574" alt="BMW M1 Hood">
  78. <img src="img/bmw_m1_side.jpg" width="765" height="574" alt="BMW M1 Side">
  79. <img src="img/viper_1.jpg" width="765" height="574" alt="Viper 1">
  80. <img src="img/viper_corner.jpg" width="765" height="574" alt="Viper Corner">
  81. <img src="img/bmw_m3_gt.jpg" width="765" height="574" alt="BMW M3 GT">
  82. <img src="img/corvette_pitstop.jpg" width="765" height="574" alt="Corvette Pitstop">
  83. </noscript>
  84. <div id="sidebar">
  85. </div>
  86. <div id="footer">
  87. </div>
  88. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" charset="utf-8"></script>
  89. <script src="jquery.lazyload.js?v=1.8.3" charset="utf-8"></script>
  90. <script type="text/javascript" charset="utf-8">
  91. $(function() {
  92. $("img.lazy").show().lazyload({
  93. effect : "fadeIn",
  94. failurelimit : 0
  95. });
  96. });
  97. </script>
  98. </body>
  99. </html>