Skip to content

Commit ee6ad9e

Browse files
committed
Removed "height:0" for images with unknown height (img.responsively-lazy), because they are not visible in unsupported browsers.
1 parent ede9595 commit ee6ad9e

File tree

6 files changed

+8
-12
lines changed

6 files changed

+8
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Let's not break it when we can enhance it.
6262

6363
## Browser support
6464

65-
The lazy loading works in browsers supporting the srcset attribute. As of August 2015 that's [62.78%](http://caniuse.com/#feat=srcset). Unsupported browsers will load the image in the src attribute. That's the image search engines and social networks will find, so it's better to make it high resolution.
65+
The lazy loading works in browsers supporting the srcset attribute. As of December 2015 that's [66.47%](http://caniuse.com/#feat=srcset). Unsupported browsers will load the image in the src attribute. That's the image search engines and social networks will find, so it's better to make it high resolution.
6666

6767
## License
6868
Free to use under the [MIT license](http://opensource.org/licenses/MIT).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "responsively-lazy",
33
"title": "Responsively Lazy",
4-
"version": "1.2.0",
4+
"version": "1.2.1",
55
"description": "Lazy load responsive images",
66
"homepage": "http://ivopetkov.com/b/lazy-load-responsive-images/",
77
"author": {

responsivelyLazy.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@
2020

2121
img.responsively-lazy{
2222
width:100%;
23-
height:0;
2423
}

responsivelyLazy.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ if (typeof responsivelyLazy === 'undefined') {
101101
if (container.lastSetOption[1] < bestSelectedOption[1]) {
102102
container.lastSetOption = bestSelectedOption;
103103
element.setAttribute('srcset', bestSelectedOption[0]);
104-
if (unknownHeight) {
105-
element.style.height = "auto";
106-
}
107104
}
108105

109106
}

responsivelyLazy.min.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* Copyright 2015, Ivo Petkov
55
* Free to use under the MIT license.
66
*/
7-
.responsively-lazy:not(img){position:relative;height:0}.responsively-lazy:not(img) img{position:absolute;top:0;left:0;width:100%;height:100%}img.responsively-lazy{width:100%;height:0}
7+
.responsively-lazy:not(img){position:relative;height:0}.responsively-lazy:not(img) img{position:absolute;top:0;left:0;width:100%;height:100%}img.responsively-lazy{width:100%;}

responsivelyLazy.min.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)