novicell-lazyload
Advanced tools
Comparing version 1.2.4 to 1.3.0
@@ -18,4 +18,6 @@ 'use strict'; | ||
window.lazySizesConfig.expand = 1000; | ||
if (window.lazySizesConfig["useWebp"] == undefined) { | ||
window.lazySizesConfig["useWebp"] = true | ||
} | ||
/* | ||
@@ -44,3 +46,3 @@ * Lazyload | ||
isSupportWebP(function(bool) { | ||
if (bool) { | ||
if (bool && window.lazySizesConfig.useWebp) { | ||
url += "&format=webp" | ||
@@ -70,3 +72,3 @@ } | ||
if (bool) { | ||
if (bool && window.lazySizesConfig.useWebp) { | ||
url += "&format=webp" | ||
@@ -81,3 +83,3 @@ } | ||
if (bool) { | ||
if (bool && window.lazySizesConfig.useWebp) { | ||
src += "&format=webp" | ||
@@ -84,0 +86,0 @@ } |
{ | ||
"name": "novicell-lazyload", | ||
"version": "1.2.4", | ||
"version": "1.3.0", | ||
"description": "Novicell script for lazyloading images.", | ||
@@ -27,2 +27,6 @@ "main": "index.js", | ||
"email": "hrm@novicell.dk" | ||
}, | ||
{ | ||
"name": "Juozas Rastenis", | ||
"email": "jra@novicell.dk" | ||
} | ||
@@ -29,0 +33,0 @@ ], |
@@ -37,5 +37,18 @@ # 💤 Novicell Lazyload | ||
```html | ||
<script> | ||
window.lazySizesConfig = { | ||
// Options . . . | ||
} | ||
</script> | ||
<script defer src="/dist/scripts/lazy.min.js"></script> | ||
``` | ||
## Options | ||
```js | ||
window.lazySizesConfig = { | ||
useWebp: true // Boolean (defaults to true). If true is used it will still check if browser supports WebP format and then add it | ||
} | ||
``` | ||
## Implementation | ||
@@ -42,0 +55,0 @@ This script *lazyloads* by swapping the `data-src` or `data-srcset` to an actual `src` or `srcset`. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15127
148
104