Skip to content

Commit 8e11ef5

Browse files
committed
fix positionX and positionY attributes (closes issue #24)
1 parent 50c1ad8 commit 8e11ef5

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

parallax.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* parallax.js v1.3 (http://pixelcog.github.io/parallax.js/)
2+
* parallax.js v1.3.1 (http://pixelcog.github.io/parallax.js/)
33
* @copyright 2015 PixelCog, Inc.
44
* @license MIT (https://github.com/pixelcog/parallax.js/blob/master/LICENSE)
55
*/
@@ -61,18 +61,16 @@
6161
positions.push(positions[0]);
6262
}
6363

64-
if (positions[0] == 'top' || positions[0] == 'bottom' ||
65-
positions[1] == 'left' || positions[1] == 'right') {
66-
self.positionX = positions[1];
67-
self.positionY = positions[0];
68-
} else {
69-
self.positionX = positions[0];
70-
self.positionY = positions[1];
64+
if (positions[0] == 'top' || positions[0] == 'bottom' || positions[1] == 'left' || positions[1] == 'right') {
65+
positions = [positions[1], positions[0]];
7166
}
7267

7368
if (this.positionX != undefined) positions[0] = this.positionX.toLowerCase();
7469
if (this.positionY != undefined) positions[1] = this.positionY.toLowerCase();
7570

71+
self.positionX = positions[0];
72+
self.positionY = positions[1];
73+
7674
if (this.positionX != 'left' && this.positionX != 'right') {
7775
if (isNaN(parseInt(this.positionX))) {
7876
this.positionX = 'center';

parallax.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)