Skip to content

Commit

Permalink
🐛 ensure simple parallax is initialized on SVG at page load
Browse files Browse the repository at this point in the history
  • Loading branch information
geosigno committed Jul 26, 2020
1 parent c27bc10 commit 7cc7564
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions dist/simpleParallax.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* simpleParallax - simpleParallax is a simple JavaScript library that gives your website parallax animations on any images or videos,
* @date: 21-06-2020 13:22:47,
* @date: 26-07-2020 15:48:32,
* @version: 5.5.1,
* @link: https://simpleparallax.com/
*/
Expand Down Expand Up @@ -199,7 +199,7 @@ var cssTransform = function cssTransform() {
// check if media is fully loaded
var isImageLoaded = function isImageLoaded(media) {
// if the media is a video, return true
if (media.tagName.toLowerCase() === 'video') {
if (media.tagName.toLowerCase() !== 'img' && media.tagName.toLowerCase() !== 'picture') {
return true;
} // check if media is set as the parameter

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

window.removeEventListener('resize', this.refresh);
window.removeEventListener('resize', this.refresh); // Reset isInit

isInit = false;
}
}
}]);
Expand Down
Loading

0 comments on commit 7cc7564

Please sign in to comment.