Skip to content

Commit

Permalink
fix #11
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangarnier committed Jun 28, 2016
1 parent a665d81 commit 1c0942c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
8 changes: 6 additions & 2 deletions anime.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,16 @@
var getAnimationType = function(el, prop) {
if ((is.node(el) || is.svg(el)) && arrayContains(validTransforms, prop)) return 'transform';
if ((is.node(el) || is.svg(el)) && (prop !== 'transform' && getCSSValue(el, prop))) return 'css';
if ((is.node(el) || is.svg(el)) && (el.getAttribute(prop) || el[prop])) return 'attribute';
if ((is.node(el) || is.svg(el)) && (el.getAttribute(prop) || (is.svg(el) && el[prop]))) return 'attribute';

This comment has been minimized.

Copy link
@bobojas77

bobojas77 Jun 30, 2016

Uyy

if (!is.null(el[prop]) && !is.undef(el[prop])) return 'object';
}

var getCSSValue = function(el, prop) {
return getComputedStyle(el).getPropertyValue(stringToHyphens(prop));
// First check if prop is a valid CSS property
if (prop in el.style) {
// Then return the property value or fallback to '0' when getPropertyValue fails
return getComputedStyle(el).getPropertyValue(stringToHyphens(prop)) || '0';
}
}

var getTransformValue = function(el, prop) {
Expand Down
12 changes: 6 additions & 6 deletions anime.min.js

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

0 comments on commit 1c0942c

Please sign in to comment.