Skip to content

Commit 5d6024a

Browse files
committed
Merge branch 'master' of https://github.com/taavilarionov/parallax.js into taavilarionov-master
* 'master' of https://github.com/taavilarionov/parallax.js: images static on Android as Spotify
2 parents 5b3e49a + 39d790d commit 5d6024a

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

parallax.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@
107107
return this;
108108
}
109109

110+
if (navigator.userAgent.match(/(Android)/)) {
111+
if (this.androidFix && !this.$element.is('img')) {
112+
this.$element.css({
113+
backgroundImage: 'url(' + this.imageSrc + ')',
114+
backgroundSize: 'cover',
115+
backgroundPosition: this.position
116+
});
117+
}
118+
return this;
119+
}
120+
110121
this.$mirror = $('<div />').prependTo('body');
111122
this.$slider = $('<img />').prependTo(this.$mirror);
112123

@@ -148,7 +159,8 @@
148159
bleed: 0,
149160
zIndex: -100,
150161
iosFix: true,
151-
position: 'center',
162+
androidFix: true,
163+
position: 'center',
152164

153165
refresh: function() {
154166
this.boxWidth = this.$element.width();

parallax.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)