image-loader-spinner
Advanced tools
Comparing version 1.1.7 to 1.1.8
@@ -61,9 +61,10 @@ "use strict"; | ||
e.target.style.display = "block"; | ||
const element = e.target; | ||
const interval = window.setInterval(() => { | ||
if (parseFloat(e.target.style.opacity) >= maxOpacity) | ||
if (parseFloat(element.style.opacity) >= maxOpacity) | ||
return window.clearInterval(interval); | ||
const opacityImage = parseFloat(e.target.style.opacity); | ||
e.target.style.opacity = opacityImage + 0.05; | ||
if (parseFloat(e.target.style.opacity) > maxOpacity) | ||
e.target.style.opacity = maxOpacity; | ||
const opacityImage = parseFloat(element.style.opacity); | ||
element.style.opacity = opacityImage + 0.05; | ||
if (parseFloat(element.style.opacity) > maxOpacity) | ||
element.style.opacity = maxOpacity; | ||
}, 1e3 / 20); | ||
@@ -70,0 +71,0 @@ } else |
{ | ||
"name": "image-loader-spinner", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "Use a spinner until your images are completely loaded in the DOM", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
39998
318