X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2F02_dom%2F10_XNodeAnime.js;h=31e853a2ffdedc2a653ebc062ed35b1fe3fa3f6d;hb=6b28a86cc49680dac50278ff5617bfe7a3d98613;hp=2520f148ddff0ec6e8c46dbd70d915b601fb4cbe;hpb=54eba266c29baf743f6ac67942a2788cd697b12d;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/02_dom/10_XNodeAnime.js b/0.6.x/js/02_dom/10_XNodeAnime.js index 2520f14..31e853a 100644 --- a/0.6.x/js/02_dom/10_XNodeAnime.js +++ b/0.6.x/js/02_dom/10_XNodeAnime.js @@ -431,27 +431,29 @@ function X_Node_Anime_updateAnimation( xnode ){ function X_Node_Anime_getComputedPosition( that ){ var raw = that[ '_rawObject' ], - x = 0, y = 0, a = 1, matrix; + x = NaN, y = NaN, a = 1, style, matrix; if( raw ){ if( X_Node_Anime_hasTransform ){ - matrix = X_Node_CSS_getComputedStyle( raw, null ); - matrix = matrix[ X_Node_CSS_VENDER_PREFIX[ 'transform' ] ].split( ')' )[ 0 ].split( ', ' ); - x = + ( matrix[ 12 ] || matrix[ 4 ] ); - y = + ( matrix[ 13 ] || matrix[ 5 ] ); - a = matrix[ X_Node_CSS_Support[ 'opacity' ] ]; + if( style = X_Node_CSS_getComputedStyle( raw, null ) ){ + matrix = ( style[ X_Node_CSS_VENDER_PREFIX[ 'transform' ] ] || '' ).split( ')' )[ 0 ].split( ', ' ); + x = + ( matrix[ 12 ] || matrix[ 4 ] ); + y = + ( matrix[ 13 ] || matrix[ 5 ] ); + a = matrix[ X_Node_CSS_Support[ 'opacity' ] ]; + }; } else if( X_Node_CSS_getComputedStyle ){ - matrix = X_Node_CSS_getComputedStyle( raw, null ); - x = parseFloat( matrix[ 'left' ] ); - y = parseFloat( matrix[ 'top' ] ); - a = matrix[ X_Node_CSS_Support[ 'opacity' ] ]; + if( style = X_Node_CSS_getComputedStyle( raw, null ) ){ + x = parseFloat( style[ 'left' ] ); + y = parseFloat( style[ 'top' ] ); + a = parseFloat( style[ X_Node_CSS_Support[ 'opacity' ] ] ); + }; } else - if( matrix = raw.currentStyle || raw.style ){ - x = parseFloat( matrix[ 'left' ] ); - y = parseFloat( matrix[ 'top' ] ); - a = matrix[ 'opacity' ]; - }; + if( style = ( raw.currentStyle || raw.style ) ){ + x = parseFloat( style[ 'left' ] ); + y = parseFloat( style[ 'top' ] ); + a = parseFloat( ( style[ 'filter' ] || 'opacity=1' ).split( 'opacity=' )[ 1 ] ); + }; }; return { x : x, y : y, a : a };