Skip to content

Commit 7cc7564

Browse files
committed
🐛 ensure simple parallax is initialized on SVG at page load
1 parent c27bc10 commit 7cc7564

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

dist/simpleParallax.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* simpleParallax - simpleParallax is a simple JavaScript library that gives your website parallax animations on any images or videos,
3-
* @date: 21-06-2020 13:22:47,
3+
* @date: 26-07-2020 15:48:32,
44
* @version: 5.5.1,
55
* @link: https://simpleparallax.com/
66
*/
@@ -199,7 +199,7 @@ var cssTransform = function cssTransform() {
199199
// check if media is fully loaded
200200
var isImageLoaded = function isImageLoaded(media) {
201201
// if the media is a video, return true
202-
if (media.tagName.toLowerCase() === 'video') {
202+
if (media.tagName.toLowerCase() !== 'img' && media.tagName.toLowerCase() !== 'picture') {
203203
return true;
204204
} // check if media is set as the parameter
205205

@@ -724,7 +724,9 @@ var simpleParallax_SimpleParallax = /*#__PURE__*/function () {
724724
// cancel the animation frame
725725
window.cancelAnimationFrame(frameID); // detach the resize event
726726

727-
window.removeEventListener('resize', this.refresh);
727+
window.removeEventListener('resize', this.refresh); // Reset isInit
728+
729+
isInit = false;
728730
}
729731
}
730732
}]);

0 commit comments

Comments
 (0)