Skip to content

Commit

Permalink
improve effect plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander.farkas committed Aug 6, 2018
1 parent 290e564 commit c38044d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugins/blur-up/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The lazysizes Blur Up plugin
# The lazysizes Blur Up/effect plugin plugin

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.

Expand Down
9 changes: 5 additions & 4 deletions plugins/blur-up/ls.blur-up.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@

var getLowSrc = function (picture, img) {
var sources = picture ? slice.call(picture.querySelectorAll('source, img')) : [img];

return sources.find(function (src) {
var element = sources.find(function (src) {
return src.getAttribute('data-lowsrc') && matchesMedia(src);
}).getAttribute('data-lowsrc');
});

return element && element.getAttribute('data-lowsrc');
};

var createBlurup = function(picture, img, src, blurUp){
Expand Down Expand Up @@ -135,7 +136,7 @@
return;
}

lazySizes.aC(img || blurImg, 'ls-inview');
lazySizes.aC(blurImg || img, 'ls-inview');

setStateUp();

Expand Down
2 changes: 1 addition & 1 deletion plugins/blur-up/ls.blur-up.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c38044d

Please sign in to comment.