Skip to content
Browse files

Added some sanity checks. Should fix #31

  • Loading branch information...
1 parent 6d5324e commit 8e509f03bc370b880e8b3f8338c15993f642b357 @fgnass fgnass committed Oct 5, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 spin.js
View
6 spin.js
@@ -270,8 +270,12 @@
}), g);
};
proto.opacity = function(el, i, val, o) {
+ var c = el.firstChild;
o = o.shadow && o.lines || 0;
- el.firstChild.childNodes[i+o].firstChild.firstChild.opacity = val;
+ if (c && i+o < c.childNodes.length) {
+ c = c.childNodes[i+o]; c = c && c.firstChild; c = c && c.firstChild;
+ if (c) c.opacity = val;
+ }
};
}
else {

0 comments on commit 8e509f0

Please sign in to comment.
Something went wrong with that request. Please try again.