Skip to content

Commit 5eea602

Browse files
committed
bugfix for mobile phone support
on mobile phones only provide fallback image, if it's set on the parallax-window element, otherwise don't
1 parent 6c32735 commit 5eea602

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

parallax.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
this.positionY + (isNaN(this.positionY)? '' : 'px');
9393

9494
if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
95-
if (this.iosFix && !this.$element.is('img')) {
95+
if (this.imageSrc && this.iosFix && !this.$element.is('img')) {
9696
this.$element.css({
9797
backgroundImage: 'url(' + this.imageSrc + ')',
9898
backgroundSize: 'cover',
@@ -103,7 +103,7 @@
103103
}
104104

105105
if (navigator.userAgent.match(/(Android)/)) {
106-
if (this.androidFix && !this.$element.is('img')) {
106+
if (this.imageSrc && this.androidFix && !this.$element.is('img')) {
107107
this.$element.css({
108108
backgroundImage: 'url(' + this.imageSrc + ')',
109109
backgroundSize: 'cover',

0 commit comments

Comments
 (0)