Skip to content

Commit 1a91906

Browse files
committed
bug fixes
1 parent faa51a5 commit 1a91906

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

jquery.parallax.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,10 @@
332332
];
333333
}
334334
TransformMatrix.fromArray = function(array, result) {
335+
result || (result = new TransformMatrix());
335336
if (array.length < 6) {
336-
return new TransformMatrix();
337+
return result;
337338
}
338-
var result = result || new TransformMatrix();
339339
for (var i=0; i<array.length; i++) {
340340
array[i] = parseFloat(array[i]);
341341
}
@@ -351,7 +351,9 @@
351351
return result;
352352
};
353353
TransformMatrix.fromEl = function(el, result) {
354-
if (!window.getComputedStyle) return;
354+
if (!window.getComputedStyle) {
355+
return result || new TransformMatrix();
356+
}
355357
var style = getComputedStyle(el),
356358
transform = style.transform || style.webkitTransform || style.mozTransform;
357359
return TransformMatrix.fromArray(transform.replace(/^matrix(3d)?\((.*)\)$/, '$2').split(/, /), result);

jquery.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)