diff --git a/README.md b/README.md index 584914b..3b18777 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,31 @@ # Lazily.js A lazy loader for lazy folks. -Inspired by [this tutorial](https://shiftbacktick.io/code/2019/08/17/lazily-lazy-loading.html). -This library leverages a `MutationObserver` to detect when elements are added to the DOM. +This library leverages a `MutationObserver` to detect when its target elements are added to the DOM. If the native `loading` attribute is supported, then it is applied. -Otherwise an `IntersectionObserver` is used to load elements as needed. +Otherwise an `IntersectionObserver` is used to load them as needed. -## Browser compatibility +## Compatibility - Compatible with all evergreen browsers -- For IE11 compatibility, please provide polyfills for `IntersectionObserver` and `MutationObserver` -- Otherwise encourage your users to dump their outdated browsers +- For IE11, please provide polyfills for `IntersectionObserver` and `MutationObserver` +- Earlier browsers may require transpilation and additional polyfills -## Standard usage -Simply add the minified script to the document ``: +## Usage +Simply add the minified script to the document ``. +For certain setups, it may be advantageous to include it inline: ```html - + + + ``` -For certain setups, it may be advantageous to include it inline. +No other markup changes are required. +It will automatically lazy load `