Closed RubyLouvre closed 11 years ago
var fx2 = "width:attr(width);\ height:attr(height);\\n\ margin-left:attr(margin-left);\ margin-right:attr(margin-right);\ margin-top:attr(margin-top);\ margin-bottom:attr(margin-bottom);\ padding-left:attr(padding-left);\ padding-right:attr(padding-right);\ padding-top:attr(padding-top);\ padding-bottom:attr(padding-bottom);\ border-left-width:attr(border-left-width);\ border-right-width:attr(border-right-width);\ border-top-width:attr(border-top-width);\ border-bottom-width:attr(border-bottom-width);" //上面代码可以由下面两个函数生成 function getCurrentStyle(name) { return name + ":attr(" + name + ");" } function LoopEdge(callback) { var dir = ["-top", "-bottom", "-left", "-right"] $.each({ margin: "", padding: "", border: "-width" }, function(prefix, suffix) { for (var i = 0; i < 4; i++) { callback(prefix + dir[i] + suffix); } }); }