Skip to content

Commit c38044d

Browse files
author
alexander.farkas
committed
improve effect plugin
1 parent 290e564 commit c38044d

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

plugins/blur-up/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# The lazysizes Blur Up plugin
1+
# The lazysizes Blur Up/effect plugin plugin
22

33
The lazysizes Blur Up plugin ([demo](https://jsfiddle.net/trixta/v0oq0412/embedded/result/)) gives you the possibility to also lazyload the low quality placeholder and enables you to create a blur up/fade over effect.
44

plugins/blur-up/ls.blur-up.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@
2929

3030
var getLowSrc = function (picture, img) {
3131
var sources = picture ? slice.call(picture.querySelectorAll('source, img')) : [img];
32-
33-
return sources.find(function (src) {
32+
var element = sources.find(function (src) {
3433
return src.getAttribute('data-lowsrc') && matchesMedia(src);
35-
}).getAttribute('data-lowsrc');
34+
});
35+
36+
return element && element.getAttribute('data-lowsrc');
3637
};
3738

3839
var createBlurup = function(picture, img, src, blurUp){
@@ -135,7 +136,7 @@
135136
return;
136137
}
137138

138-
lazySizes.aC(img || blurImg, 'ls-inview');
139+
lazySizes.aC(blurImg || img, 'ls-inview');
139140

140141
setStateUp();
141142

plugins/blur-up/ls.blur-up.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)