aboutsummaryrefslogtreecommitdiffstats
path: root/src/effects
diff options
context:
space:
mode:
authorCorey Frang <gnarf@gnarf.net>2015-05-18 17:11:21 -0400
committerCorey Frang <gnarf@gnarf.net>2015-06-26 20:11:55 -0400
commit6b10f9d7e9fb6d062d2bbda49196544cd059b05c (patch)
treeec7a1188a991e3c374547e594a12313cbf8a47ce /src/effects
parentbf282ea8e20892af2d1d2c76b93b0c1f2141db97 (diff)
downloadjquery-6b10f9d7e9fb6d062d2bbda49196544cd059b05c.tar.gz
jquery-6b10f9d7e9fb6d062d2bbda49196544cd059b05c.zip
Effects: Add tests for jQuery.Tween
Conflicts: src/selector-native.js test/index.html test/unit/effects.js
Diffstat (limited to 'src/effects')
-rw-r--r--src/effects/Tween.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/effects/Tween.js b/src/effects/Tween.js
index 810d11133..8f9519410 100644
--- a/src/effects/Tween.js
+++ b/src/effects/Tween.js
@@ -59,8 +59,10 @@ Tween.propHooks = {
get: function( tween ) {
var result;
- if ( tween.elem[ tween.prop ] != null &&
- (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
+ // Use a property on the element directly when it is not a DOM element,
+ // or when there is no matching style property that exists.
+ if ( tween.elem.nodeType !== 1 ||
+ tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
return tween.elem[ tween.prop ];
}
@@ -77,7 +79,7 @@ Tween.propHooks = {
// available and use plain properties where available
if ( jQuery.fx.step[ tween.prop ] ) {
jQuery.fx.step[ tween.prop ]( tween );
- } else if ( tween.elem.style &&
+ } else if ( tween.elem.nodeType === 1 &&
( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
jQuery.cssHooks[ tween.prop ] ) ) {
jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );