function MM_scanStyles(obj, prop) { //v9.0
var inlineStyle = null; var ccProp = prop; var dash = ccProp.indexOf("-");
while (dash != -1){ccProp = ccProp.substring(0, dash) + ccProp.substring(dash+1,dash+2).toUpperCase() + ccProp.substring(dash+2); dash = ccProp.indexOf("-");}
inlineStyle = eval("obj.style." + ccProp);
if(inlineStyle) return inlineStyle;
var ss = document.styleSheets;
for (var x = 0; x < ss.length; x++) { var rules = ss[x].cssRules;
for (var y = 0; y < rules.length; y++) { var z = rules[y].style;
if(z[prop] && (rules[y].selectorText == '*[ID"' + obj.id + '"]' || rules[y].selectorText == '#' + obj.id)) {
return z[prop];
} } } return "";
}
var inlineStyle = null; var ccProp = prop; var dash = ccProp.indexOf("-");
while (dash != -1){ccProp = ccProp.substring(0, dash) + ccProp.substring(dash+1,dash+2).toUpperCase() + ccProp.substring(dash+2); dash = ccProp.indexOf("-");}
inlineStyle = eval("obj.style." + ccProp);
if(inlineStyle) return inlineStyle;
var ss = document.styleSheets;
for (var x = 0; x < ss.length; x++) { var rules = ss[x].cssRules;
for (var y = 0; y < rules.length; y++) { var z = rules[y].style;
if(z[prop] && (rules[y].selectorText == '*[ID"' + obj.id + '"]' || rules[y].selectorText == '#' + obj.id)) {
return z[prop];
} } } return "";
}
scan 检查 搜索
style 样式var inlineStyle = null; //设置 inlineStyle为null
var ccProp = prop; // 复制 prop 的值到 ccProp
...
后面耐心点 按照我这样一行行 写出意思 注释就出来了