Skip to content

Commit

Permalink
Additionnal check to avoid missing style
Browse files Browse the repository at this point in the history
Fixes #73
  • Loading branch information
trochr authored Apr 25, 2019
1 parent 7999350 commit 13ddb9b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions smartscroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,15 @@ function deepCss(who, css) {
sty = css.replace(/\-([a-z])/g, function (a) {
return a.toUpperCase();
});
val = who.style[sty];
if (!val) {
if (who.currentStyle) {
val = who.currentStyle[sty];
} else if (dv.getComputedStyle) {
val = dv.getComputedStyle(who, "").getPropertyValue(css);
if (who.style != undefined) {
val = who.style[sty];
if (!val) {
if (who.currentStyle) {
val = who.currentStyle[sty];
} else if (dv.getComputedStyle) {
val = dv.getComputedStyle(who, "").getPropertyValue(css);
}
}
}
}
return val || "";
}
Expand Down

0 comments on commit 13ddb9b

Please sign in to comment.