Skip to content

Commit d879c3e

Browse files
author
aFarkas
committed
0.2.1
1 parent 93f0f41 commit d879c3e

File tree

7 files changed

+12
-17
lines changed

7 files changed

+12
-17
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ window.lazySizesConfig = {
101101
Here the list of options:
102102

103103
* ``lazySizesConfig.lazyClass`` (default: ``"lazyload"``): Marker class for all elements which should be lazy loaded (There can be only one ``class``. In case you need to add some other element, without the defined class, simply add it per JS: ``$('.lazy-others').addClass('lazyload');``)
104-
* ``lazySizesConfig.preloadAfterLoad`` (default: ``false``): Wether lazysizes should load all elements after the window onload event. (Note: lazysizes will then load all elements using a queue. Only two parallel elements are loaded at the same time. This makes sure that other postboned downloads are also loaded.). It's unsure wether this should be ``true`` by default. Recommendation: Set this to ``true`` at in case you don't use the LQIP pattern.
104+
* ``lazySizesConfig.preloadAfterLoad`` (default: ``false``): Wether lazysizes should load all elements after the window onload event. (Note: lazysizes will then load all elements using a queue. Only two parallel elements are loaded at the same time. This makes sure that other postboned downloads are also loaded.). It's unsure wether this should be ``true`` by default (depends...). Recommendation: Set this to ``true`` in case you don't use the LQIP pattern or you do not optimize for mobile.
105105
* ``lazySizesConfig.onlyLargerSizes`` (default: ``true``): In case a responsive image had the ``data-sizes="auto"`` attribute and the computed new size decreases, lazysizes won't normally change the ``sizes`` attribute to a lower value.
106106
* ``lazySizesConfig.srcAttr`` (default: ``"data-src"``): The attribute, which should be transformed to ``src``.
107107
* ``lazySizesConfig.srcset`` (default: ``"data-srcset"``): The attribute, which should be transformed to ``srcset``.
@@ -171,7 +171,7 @@ Due to the fact, that it is designed to be invoked with a high frequency and the
171171
<img src="lqip-src.jpg" data-src="image.jpg" class="lazyload" />
172172
```
173173

174-
##Specifying image dimensions
174+
##Specifying image dimensions (minimizing reflows)
175175
To minimize reflows and content jumping the width **and** the height of an image should be specified. For "static" images this can done using either CSS or using the content attributes:
176176

177177
```html
@@ -183,7 +183,7 @@ To minimize reflows and content jumping the width **and** the height of an image
183183
http://placehold.it/700x300 2x" class="lazyload" />
184184
```
185185

186-
For flexible responsive images the [intrinsic ratio scaling](http://www.smashingmagazine.com/2013/09/16/responsive-images-performance-problem-case-study/) can be used:
186+
For flexible responsive images [CSS intrinsic ratio scaling](http://alistapart.com/article/creating-intrinsic-ratios-for-video/) can be used:
187187

188188
```html
189189
<style>
@@ -196,7 +196,7 @@ For flexible responsive images the [intrinsic ratio scaling](http://www.smashing
196196
.ratio-container img,
197197
.ratio-container video,
198198
.ratio-container iframe {
199-
position: absolute;
199+
position: absolute;
200200
top: 0;
201201
left: 0;
202202
width: 100%;

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "lazysizes",
33
"repo": "afarkas/lazysizes",
4-
"version": "0.2.1-pre",
4+
"version": "0.2.1",
55
"main": "lazysizes.min.js",
66
"scripts": [
77
"lazysizes.min.js"

component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lazysizes",
3-
"version": "0.2.1-pre",
3+
"version": "0.2.1",
44
"repo": "afarkas/lazysizes",
55
"main": "lazysizes.min.js",
66
"scripts": ["lazysizes.min.js"],

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ <h3>Third slide label</h3>
351351
<div class="caption">
352352
<h3>Widgets/Javascript/Script</h3>
353353
<p>Simply add a a <code>data-src</code> to your widget (has to be a <code>div</code>/<code>span</code> element) and you are done:</p>
354-
<pre>&lt;div data-ride="carousel" data-tag="script" data-src="assets/js/bootstrap.min.js" class="carousel lazyload"&gt;
354+
<pre>&lt;div data-ride="carousel" data-src="assets/js/bootstrap.min.js" class="carousel lazyload"&gt;
355355
&lt;!-- widget content --&gt;
356356
&lt;div&gt;
357357
</pre>

lazysizes.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
var addRemoveImgEvents = function(dom, fn, add){
2828
var action = add ? 'addEventListener' : 'removeEventListener';
2929
dom[action]('load', fn, false);
30-
dom[action]('abort', fn, false);
31-
dom[action]('readystatechange', fn, false);
3230
dom[action]('error', fn, false);
3331
};
3432
var unveilAfterLoad = function(e){
@@ -87,7 +85,7 @@
8785
}
8886
respimage({reparse: true, elements: [el]});
8987
} else if(!window.HTMLPictureElement && window.console && document.readyState == 'complete'){
90-
console.log('Please use a responsive image polyfill, like respimage or picturefill. https://github.com/aFarkas/respimage');
88+
console.log('use a respimg polyfill: http://bit.ly/1FCts3P');
9189
}
9290
}
9391

@@ -257,9 +255,6 @@
257255
elem.setAttribute('sizes', sizes);
258256
}
259257
elem.removeAttribute(lazySizesConfig.sizesAttr);
260-
if (!srcset && window.console && elem.getAttribute('srcset')){
261-
console.log('using lazysizes with a `srcset` attribute is not good. Use `data-srcset` instead');
262-
}
263258
}
264259

265260
if(srcset){
@@ -329,7 +324,7 @@
329324
}
330325

331326
function updateSizes(elem, noPolyfill){
332-
var parentWidth, elemWidth, width, cbWidth, parent, sources, i, len, event;
327+
var parentWidth, elemWidth, width, parent, sources, i, len, event;
333328
parent = elem.parentNode;
334329

335330
if(parent){

lazysizes.min.js

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lazysizes",
3-
"version": "0.2.1-pre",
3+
"version": "0.2.1",
44
"engines": {
55
"node": ">= 0.8.0"
66
},

0 commit comments

Comments
 (0)