Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/taavilarionov/parallax.js
Browse files Browse the repository at this point in the history
…into taavilarionov-master

* 'master' of https://github.com/taavilarionov/parallax.js:
  images static on Android as Spotify
  • Loading branch information
mikegreiling committed Nov 16, 2014
2 parents 5b3e49a + 39d790d commit 5d6024a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion parallax.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@
return this;
}

if (navigator.userAgent.match(/(Android)/)) {
if (this.androidFix && !this.$element.is('img')) {
this.$element.css({
backgroundImage: 'url(' + this.imageSrc + ')',
backgroundSize: 'cover',
backgroundPosition: this.position
});
}
return this;
}

this.$mirror = $('<div />').prependTo('body');
this.$slider = $('<img />').prependTo(this.$mirror);

Expand Down Expand Up @@ -148,7 +159,8 @@
bleed: 0,
zIndex: -100,
iosFix: true,
position: 'center',
androidFix: true,
position: 'center',

refresh: function() {
this.boxWidth = this.$element.width();
Expand Down
2 changes: 1 addition & 1 deletion parallax.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5d6024a

Please sign in to comment.