Version Description
Added fadeIn effect
Download this release
Release Info
Developer | bjornjohansen |
Plugin | BJ Lazy Load |
Version | 0.5.2 |
Comparing to | |
See all releases |
Code changes from version 0.5.1 to 0.5.2
- bj-lazy-load.php +2 -2
- js/bj-lazy-load.js +11 -5
- js/bj-lazy-load.min.js +1 -1
- readme.txt +7 -1
bj-lazy-load.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: BJ Lazy Load
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/bj-lazy-load/
|
5 |
Description: Lazy image loading makes your site load faster and saves bandwidth.
|
6 |
-
Version: 0.5.
|
7 |
Author: Bjørn Johansen
|
8 |
Author URI: http://twitter.com/bjornjohansen
|
9 |
License: GPL2
|
@@ -31,7 +31,7 @@ require_once( dirname(__FILE__) . '/scb/load.php' );
|
|
31 |
if ( ! class_exists( 'BJLL' ) ) {
|
32 |
class BJLL {
|
33 |
|
34 |
-
const version = '0.5.
|
35 |
protected $_placeholder_url;
|
36 |
|
37 |
protected static $_instance;
|
3 |
Plugin Name: BJ Lazy Load
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/bj-lazy-load/
|
5 |
Description: Lazy image loading makes your site load faster and saves bandwidth.
|
6 |
+
Version: 0.5.2
|
7 |
Author: Bjørn Johansen
|
8 |
Author URI: http://twitter.com/bjornjohansen
|
9 |
License: GPL2
|
31 |
if ( ! class_exists( 'BJLL' ) ) {
|
32 |
class BJLL {
|
33 |
|
34 |
+
const version = '0.5.2';
|
35 |
protected $_placeholder_url;
|
36 |
|
37 |
protected static $_instance;
|
js/bj-lazy-load.js
CHANGED
@@ -2,18 +2,24 @@
|
|
2 |
|
3 |
function bj_lazy_load_init() {
|
4 |
|
5 |
-
$('.lazy-hidden').not('
|
6 |
|
7 |
var $el = $( this ),
|
8 |
data_lazy_type = $el.attr( 'data-lazy-type' );
|
9 |
|
10 |
if ( data_lazy_type == 'image' ) {
|
11 |
-
$el.
|
12 |
-
.
|
|
|
|
|
13 |
} else if ( data_lazy_type == 'iframe' ) {
|
14 |
-
$el.replaceWith(
|
|
|
|
|
|
|
|
|
15 |
}
|
16 |
-
}).
|
17 |
|
18 |
}
|
19 |
|
2 |
|
3 |
function bj_lazy_load_init() {
|
4 |
|
5 |
+
$('.lazy-hidden').not('.data-lazy-ready').one( 'scrollin.bj_lazy_load', { distance: 200 }, function() {
|
6 |
|
7 |
var $el = $( this ),
|
8 |
data_lazy_type = $el.attr( 'data-lazy-type' );
|
9 |
|
10 |
if ( data_lazy_type == 'image' ) {
|
11 |
+
$el.hide()
|
12 |
+
.attr( 'src', $el.attr( 'data-lazy-src' ) )
|
13 |
+
.removeClass( 'lazy-hidden' )
|
14 |
+
.fadeIn();
|
15 |
} else if ( data_lazy_type == 'iframe' ) {
|
16 |
+
$el.replaceWith(
|
17 |
+
bj_lazy_load_base64_decode(
|
18 |
+
$el.attr( 'data-lazy-src' )
|
19 |
+
)
|
20 |
+
);
|
21 |
}
|
22 |
+
}).addClass( 'data-lazy-ready' );
|
23 |
|
24 |
}
|
25 |
|
js/bj-lazy-load.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(
|
1 |
+
(function(a){function b(){a(".lazy-hidden").not(".data-lazy-ready").one("scrollin.bj_lazy_load",{distance:200},function(){var b=a(this),d=b.attr("data-lazy-type");if(d=="image"){b.hide().attr("src",b.attr("data-lazy-src")).removeClass("lazy-hidden").fadeIn()}else if(d=="iframe"){b.replaceWith(c(b.attr("data-lazy-src")))}}).addClass("data-lazy-ready")}function c(a){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var c,d,e,f,g,h,i,j,k=0,l=0,m="",n=[];if(!a){return a}a+="";do{f=b.indexOf(a.charAt(k++));g=b.indexOf(a.charAt(k++));h=b.indexOf(a.charAt(k++));i=b.indexOf(a.charAt(k++));j=f<<18|g<<12|h<<6|i;c=j>>16&255;d=j>>8&255;e=j&255;if(h==64){n[l++]=String.fromCharCode(c)}else if(i==64){n[l++]=String.fromCharCode(c,d)}else{n[l++]=String.fromCharCode(c,d,e)}}while(k<a.length);m=n.join("");return m}a(document).bind("ready",b)})(jQuery)
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: images, iframes, lazy loading, jquery, javascript, optimize, performance,
|
|
5 |
Author URI: http://twitter.com/bjornjohansen
|
6 |
Requires at least: 3.3
|
7 |
Tested up to: 3.4.1
|
8 |
-
Stable tag: 0.5.
|
9 |
|
10 |
Lazy loading makes your site load faster and saves bandwidth. Uses jQuery and degrades gracefully for non-js users. Works with both images and iframes.
|
11 |
|
@@ -56,6 +56,9 @@ Check your HTML source or see the magic at work in Web Inspector, FireBug or sim
|
|
56 |
|
57 |
== Changelog ==
|
58 |
|
|
|
|
|
|
|
59 |
= Version 0.5.1 =
|
60 |
* Lowered jQuery version dependency
|
61 |
* New options: More granular control on what content to lazy load
|
@@ -116,6 +119,9 @@ Check your HTML source or see the magic at work in Web Inspector, FireBug or sim
|
|
116 |
|
117 |
== Upgrade Notice ==
|
118 |
|
|
|
|
|
|
|
119 |
= 0.5.0 =
|
120 |
Lazy load images and iframes. Complete rewrite.
|
121 |
|
5 |
Author URI: http://twitter.com/bjornjohansen
|
6 |
Requires at least: 3.3
|
7 |
Tested up to: 3.4.1
|
8 |
+
Stable tag: 0.5.2
|
9 |
|
10 |
Lazy loading makes your site load faster and saves bandwidth. Uses jQuery and degrades gracefully for non-js users. Works with both images and iframes.
|
11 |
|
56 |
|
57 |
== Changelog ==
|
58 |
|
59 |
+
= Version 0.5.2 =
|
60 |
+
* Added the fadeIn effect
|
61 |
+
|
62 |
= Version 0.5.1 =
|
63 |
* Lowered jQuery version dependency
|
64 |
* New options: More granular control on what content to lazy load
|
119 |
|
120 |
== Upgrade Notice ==
|
121 |
|
122 |
+
= 0.5.2 =
|
123 |
+
Added fadeIn effect
|
124 |
+
|
125 |
= 0.5.0 =
|
126 |
Lazy load images and iframes. Complete rewrite.
|
127 |
|