OSDN Git Service

Version 0.6.149, fix X.Audio & X.UI.
[pettanr/clientJs.git] / 0.6.x / js / 02_dom / 06_XNodeCSS.js
index ce4a789..9a9d85b 100644 (file)
@@ -504,8 +504,20 @@ function X_Node_CSS__splitValueAndUnit( v ){
 // unitID, name 単位指定のプロパティ取得 geter
 // obj setter
 // name, value setter
-
-Node.prototype[ 'css' ] = function( nameOrObj /* orUnitID, valuOrUnitOrName */ ){
+/**
+ * style の getter と setter。
+ * @alias Node.prototype.css
+ * @param {string|object} [nameOrObj] style 名、または追加する style のハッシュ
+ * @param {string|number} [value=] style の値
+ * @return {Node|string|number} getter の場合は値を、setter の場合は自身を返す。(メソッドチェーン)
+ * @example // getter
+ * node.css( 'color' );
+ * // setter - 1
+ * node.css( { width : w + 'px', height : h + 'px' } );
+ * // setter - 2
+ * node.css( 'color', 0x666666 );
+ */
+Node.prototype[ 'css' ] = function( nameOrObj /* value */ ){
        var args = arguments,
                css  = this[ '_css' ],
                p, name, v, plain, camelize, flags;
@@ -543,7 +555,7 @@ Node.prototype[ 'css' ] = function( nameOrObj /* orUnitID, valuOrUnitOrName */ )
        };
 // getter
        if( !css ) return;
-       // 集計 border, padding, margin, backgroundPosition, clip
+       // TODO 集計 border, padding, margin, backgroundPosition, clip
        // TODO border で正確なデータを返せない時は、null を返す
        return css[ X_Node_CSS_camelize( nameOrObj ) ];
 };