Skip to content

Commit

Permalink
Fix broken Markdown headings
Browse files Browse the repository at this point in the history
  • Loading branch information
bryant1410 committed Apr 16, 2017
1 parent 7bc6ba9 commit 5b3a82d
Show file tree
Hide file tree
Showing 18 changed files with 84 additions and 84 deletions.
12 changes: 6 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#Changelog
# Changelog

##2.0.0
## 2.0.0

* lazysizes core:
* heavily improved performance (`requestIdleCallback`, better debouncing and a lot more).
* plugins:
* new plugin: [**object fit polyfill**](plugins/object-fit).
* improved new options for [parent-fit plugin](plugins/parent-fit).

##1.5.0
## 1.5.0
Breaking change:
* the lazysizes.js and lazysizes.min.js files do not register as AMD modules anymore, if you need an AMD module use the new lazysizes-umd.js or lazysizes-umd.min.js file.
* lazysizes core:
Expand All @@ -21,7 +21,7 @@ Breaking change:
* unload plugin:
unload plugin was broken since version 1.4.0 (thanks to @hokamoto)

##1.4.0
## 1.4.0
* lazysizes core:
* improved lazyloading in background tabs.
* improved avoiding layout thrashing
Expand All @@ -31,7 +31,7 @@ Breaking change:
* rias (and bgset):
* added support for height calculation (thx to @LRancez, [#213](https://github.com/aFarkas/lazysizes/pull/213))

##1.3.2
## 1.3.2

* lazysizes core:
* add `hFactor` option (see #181).
Expand All @@ -40,7 +40,7 @@ Breaking change:
* bgset plugin:
* add an empty alt to image (see #200).

##1.3.1 version
## 1.3.1 version

* lazysizes core:
* replace `setImmediate` with `setTimeout` (improved performance for IE/EDGE).
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ It may become also your number one tool to integrate responsive images. It can a
```


##[Demo with code examples](http://afarkas.github.io/lazysizes/#examples)
## [Demo with code examples](http://afarkas.github.io/lazysizes/#examples)
Can be seen [here](http://afarkas.github.io/lazysizes/#examples)

## Responsive image support (picture and/or srcset)
Expand Down Expand Up @@ -417,7 +417,7 @@ $(document).on('lazybeforesizes', function(e){
```

#### JS API - methods
#####``lazySizes.loader.unveil(DOMNode)``
##### ``lazySizes.loader.unveil(DOMNode)``

In case a developer wants to show an image even if it is not inside the viewport the ``lazySizes.loader.unveil(DOMNode)`` can be called:

Expand All @@ -427,19 +427,19 @@ lazySizes.loader.unveil(imgElem);

Note: As a more lazy alternative the ``lazypreload`` class can be set: ``$(imgElem).addClass('lazypreload');``.

#####``lazySizes.autoSizer.checkElems()``
##### ``lazySizes.autoSizer.checkElems()``

In case one or more image elements with the attribute ``data-sizes="auto"`` have changed in size ``lazySizes.autoSizer.updateElems`` can be called (For example to implement element queries):

```js
lazySizes.autoSizer.checkElems();
```

#####``lazySizes.loader.checkElems()``
##### ``lazySizes.loader.checkElems()``

Tests whether new elements has came into view. Normally this method only needs to be called, if ``lazySizesConfig.loadMode`` was set to ``0``.

#####``lazySizes.init()``
##### ``lazySizes.init()``

LazySizes initializes itself automatically. In case you set ``lazySizesConfig.init`` to ``false`` you need to explicitly call ``lazySizes.init()``. Note: You can speed up initial loading of in view images if you call `lazySizesConfig.init()` explicitly after lazysizes and all plugins are loaded.

Expand Down
2 changes: 1 addition & 1 deletion plugins/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#lazysizes plugins/extensions/snippets
# lazysizes plugins/extensions/snippets

**lazysizes** works out of the box with standard and responsive images (``src``, ``srcset`` and ``picture``) and iframes.

Expand Down
6 changes: 3 additions & 3 deletions plugins/aspectratio/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#lazysizes aspectratio extension
# lazysizes aspectratio extension

This plugin helps to pre-occupy the space needed for an image by calculating the height from the image width or the width from the height (This means the width or height has to be calculable before the image is loaded). This can serve as an alternative to the different CSS intrinsic ratio patterns.

Note: The CSS patterns are recommended, but especially in case of different ratio's for art directed images not so convenient.

##Markup API:
## Markup API:

The value of the ``data-aspectratio`` has to be defined as the *width* divided by the *height* of the image.

Expand Down Expand Up @@ -47,7 +47,7 @@ Example values for an image with a width of 400 and a height of 200 (all mean th
</picture>
```

##JS API
## JS API

In case new elements are added to the DOM the global ``imageRatio.processImages`` method can be used. The method takes either an element representing the container/wrapper of the new elements or a list of image elements:

Expand Down
2 changes: 1 addition & 1 deletion plugins/attrchange/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#lazysizes attribute change / re-initialization extension
# lazysizes attribute change / re-initialization extension

In case you are changing the ``data-src``/``data-srcset`` attributes of already transformed lazyload elements dynamically, you normally also must re-add the ``lazyload`` class to the element.

Expand Down
2 changes: 1 addition & 1 deletion plugins/bgset/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#lazysizes bgset extension - responsive background images
# lazysizes bgset extension - responsive background images

This simple and small plugin allows you to define multiple background images with a width descriptor, similar to how ``img[srcset]`` works as also art directed images using media queries, similar to how ``picture`` works.

Expand Down
4 changes: 2 additions & 2 deletions plugins/custommedia/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#lazysizes custommedia extension
# lazysizes custommedia extension

lazySizes custommedia extension allows you to automatically sync and manage your breakpoints between your CSS and the ``media`` attributes of your ``"picture > source"`` elements using the ``customMedia`` option of lazySizes.

##Configuration via CSS
## Configuration via CSS

The following CSS...

Expand Down
30 changes: 15 additions & 15 deletions plugins/include/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#lazysizes include plugin
# lazysizes include plugin

**lazysizes** include extension/plugin asynchronously include non crucial content, styles or JS modules. Due to lazyloading, prioritized queuing and preload after load techniques lazySizes include extension scales much better than similar other solutions.

Expand All @@ -11,7 +11,7 @@ Typical use cases are:
* clean and simple architecture for initialization/loading and/or destroying/unloading of (conditional) JS behaviors
* deferred self-initializing of DOM behaviors

##Basic usage
## Basic usage

Put a ``data-include`` attribute on your ``.lazyload`` element and reference the URL to load:

Expand All @@ -30,7 +30,7 @@ The ``data-include`` can also consume a list of candidates represented by a URL

The condition is either a media query or the name of a configured condition rule. The condition rule can be configured through CSS or through JS via the ``include.conditions`` option.

###Condition configuration through CSS
### Condition configuration through CSS

The Lazysizes include extension checks wether the condition name matches the CSS ``content`` value the of ``:after`` or ``:before`` pseudo elements from the ``html`` element (can be configured).

Expand Down Expand Up @@ -59,7 +59,7 @@ html:after {
</div>
```

###Condition configuration through JS
### Condition configuration through JS

A condition can also be configured through the ``lazySizesConfig.include.conditions`` option map. Each key is either a string representing a media query or a function:

Expand Down Expand Up @@ -104,7 +104,7 @@ document.addEventListener('lazyincluded', function(e){
</div>
```

###Loading Styles or (AMD) Modules
### Loading Styles or (AMD) Modules

The include feature can also load CSS, AMD or ES6 modules. To mark an URL as CSS put a ``css:``, to load an AMD module put a ``amd:`` or to load an ES6 module put a ``module:`` identifier in front of the URL:

Expand All @@ -127,7 +127,7 @@ Content, Style and AMD includes can also be mixed and used with or without condi

In case content and a behavior include is used together lazySizes will load them in parallel but makes sure to first include the content and then initialize the behavior.

####AMD/ES6 module features
#### AMD/ES6 module features

While you can write your AMD/ES6 module how you want lazysizes include extension will check wether your module provides the following methods:

Expand Down Expand Up @@ -205,7 +205,7 @@ In case the content doesn't contain any mutable states, that need to be transfer

The data object is shared between the ``lazyunload``, ``lazytransform`` and ``lazyload`` so that a possible state can be transferred.

####Loading multiple styles and modules
#### Loading multiple styles and modules

Multiple styles or AMD modules for one candidate can be configured by separating them with ``|,|`` signs:

Expand All @@ -217,7 +217,7 @@ Multiple styles or AMD modules for one candidate can be configured by separating
</div>
```

###Scalability and queue priority
### Scalability and queue priority

The include feature will always use a download queue to make sure, that multiple includes do not jam the browsers own request queue. In case of many non crucial includes mixed with some crucial includes on one page the ``data-lazyqueue`` attribute can be used to add a queue priority for the include extension:

Expand Down Expand Up @@ -252,16 +252,16 @@ The include feature will always use a download queue to make sure, that multiple
</div>
```

###Events
### Events

* ``lazyincludeload`` is a cancelable event fired at the element before the request is started. The ``event.detail`` object can be used to modify the XHR request.
* ``lazyincludeloaded`` is a cancelable event fired at the element after the request is complete, but before the content is added. The ``event.detail.content`` property can be used to modify the content (for example to transform JSON to HTML).
* ``lazyincluded`` is an event fired at the element right after the HTML was injected.

###Options
### Options
All include options are configurable through the ``lazySizesConfig.include`` option object:

####``contentElement`` (default: ``"html"``):
#### ``contentElement`` (default: ``"html"``):

The selector of the element, which should be used to check for the CSS content value:

Expand All @@ -274,7 +274,7 @@ window.lazySizesConfig = {
};
```

####``conditions`` option (default: ``{}``):
#### ``conditions`` option (default: ``{}``):
The conditions option can be used to create new custom conditions.

```js
Expand All @@ -291,7 +291,7 @@ window.lazySizesConfig = {
};
```

####``map`` option (default: ``{}``):
#### ``map`` option (default: ``{}``):

The ``map`` option allows to map the value of the ``data-include`` attribute to another string. This does not only work for the hole value, but also for parsed parts.

Expand All @@ -317,7 +317,7 @@ This option becomes useful to separate content from behavior.

The include feature works together with all normal lazySizes options (i.e.: ``addClasses`` for load indicators), events and methods.

##Reacting to user interaction
## Reacting to user interaction

Of course it is also possible to react to a user interaction.

Expand Down Expand Up @@ -366,7 +366,7 @@ $(document).on('click', '.load-include', function(){
</script>
```

##Sharing States between two modules
## Sharing States between two modules


```html
Expand Down
8 changes: 4 additions & 4 deletions plugins/noscript/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#lazysizes noscript/progressive enhancement extension
# lazysizes noscript/progressive enhancement extension

The noscript extension is the true ultimate progressive enhancement extension for lazySizes. It allows you to transform any HTML inside a ``noscript`` element as soon as it becomes visible.

##Markup
## Markup

The ``lazyload`` class has to be added to the parent element of the ``noscript`` element and this element has to also have a ``data-noscript`` attribute. As soon as it is near the viewport the content of the ``noscript`` element will replace the content of the ``.lazyload` element.

Expand Down Expand Up @@ -47,7 +47,7 @@ The ``lazyload`` class has to be added to the parent element of the ``noscript``

**Important note**: While you also can transform responsive images with this plugin, neither the ``data-sizes`` nor the ``customMedia`` features do work with the ``noscript`` extension. Also note: Android 2.x is not supported with this plugin.

##Troubleshooting: Escaped HTML entities
## Troubleshooting: Escaped HTML entities
Normally the content of a ``noscript`` must be retrieved as text. But in some cases for example, if the ``noscript`` element was created in a XML documented/context, it must be retrieved as HTML. This can't be automatically detected.

In case this happens, you can fix this either by making sure that ``noscript`` elements are always created in a *text/html* context or by overriding the ``getNoscriptContent`` option callback:
Expand All @@ -60,7 +60,7 @@ window.lazySizesConfig.getNoscriptContent = function(noScript){
};
```

##<a name="ie8"></a>Add IE8- support with conditional comments
## <a name="ie8"></a>Add IE8- support with conditional comments
The noscript extension can also be used in conjunction with conditional comments to add progressive enhancement support for IE8-:

```html
Expand Down
10 changes: 5 additions & 5 deletions plugins/object-fit/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#lazySizes object fit extension
# lazySizes object fit extension

This extension polyfills `object-fit`: `cover` and `contain` properties as also the `object-position` in non supporting browsers. Here you find a [simple demo](https://jsfiddle.net/trixta/x2p17f31/).

##Usage
## Usage

###Include JS files:
### Include JS files:
Include lazysizes and lazysizes object fit and optionally lazysizes parent-fit and lazysizes respimg plugin. Lazysizes object-fit and respimg plugin are only needed in browser that don't support object fit or responsive images. Lazysizes parent-fit is recommended if you use object fit responsive images in combination with `data-sizes="auto"`.

```html
Expand All @@ -18,7 +18,7 @@ Include lazysizes and lazysizes object fit and optionally lazysizes parent-fit a
<script src="../plugins/respimg/ls.respimg.min.js"></script>
```

###Add markup
### Add markup
The object-fit plugin is not a full polyfill.

```html
Expand All @@ -39,7 +39,7 @@ The object-fit plugin is not a full polyfill.
</div>
```

###CSS
### CSS

To init the plugin on an image simply use the `font-family` property directly on your image.

Expand Down
10 changes: 5 additions & 5 deletions plugins/optimumx/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#lazysizes optimumx plugin
# lazysizes optimumx plugin

**lazysizes** optimumx plugin helps you to limit/constrain the maximum resolution in case the **w descriptor** is used. Simply add the attribute ``data-optimumx="1.6"`` to constrain the max resolution to 1.6.

Expand All @@ -21,7 +21,7 @@ This plugin depends on the ``data-sizes="auto"`` feature of **lazysizes**.

A **simple [demo can be seen here](http://afarkas.github.io/lazysizes/optimumx/)**. This extension also supports art-directed responsive images using the ``picture`` element.

##Usage
## Usage

```html
<!-- concat the following scripts into one and add them to your HTML -->
Expand Down Expand Up @@ -76,7 +76,7 @@ In case you want to use a CDN you can use the combohandler service provided by j
<script src="http://cdn.jsdelivr.net/g/lazysizes(lazysizes.min.js+plugins/optimumx/ls.optimumx.min.js)" async=""></script>
```

###The ``getOptimumX`` option callback
### The ``getOptimumX`` option callback

Normally the image specific optimal pixel density should be added as a floating point number using the ``data-optimumx`` attribute. Additionally it is also possible to add the ``"auto"`` keyword as a value of the ``data-optimumx`` attribute. In that case the ``getOptimumX`` option callback is invoked with the element as the first argument.

Expand Down Expand Up @@ -117,7 +117,7 @@ window.lazySizesConfig.config.getOptimumX = function(/*element*/){
};
```

##<a name="compressive-picture-pattern"></a>Background information: Compressive picture pattern
## <a name="compressive-picture-pattern"></a>Background information: Compressive picture pattern

From a perceived performance vs. perceived quality standpoint the best way to deal with High DPI images is to serve higher compressed candidates to clients with high resolution displays.

Expand Down Expand Up @@ -173,7 +173,7 @@ Unfortunately these techniques also double or even triple (think 1x: 65-85q, 2x:

But be aware each image has different characteristics: While some images look great on a HIGH DPI device even with a ``data-optimumx="1.2"`` other will need a much higher density for a good perceived quality.

##<a name="lying-sizes"></a>Background information: Lying sizes attribute
## <a name="lying-sizes"></a>Background information: Lying sizes attribute

There is also another much more lightweight way to get a similar effect. Instead of parsing and constraining the ``srcset`` to meet the ``data-optimumx`` constraint, there is also the possibility to modify the ``sizes`` attribute instead.

Expand Down
Loading

0 comments on commit 5b3a82d

Please sign in to comment.