2012-06-13 29 views
1

我在Chrome 19和我创建了一个新的突变观察对象:突变Obervers在Chrome中未检测出属性和CSS改变

var observer = new WebKitMutationObserver(function(mutations, observer) { 
    console.log(mutations, observer); 
}); 

然后我观察:

observer.observe(document, { 
    subtree: true, 
    childList: true, 
    characterData: true, 
    attribute: true  
}); 

看来,当我插入或删除节点或更改节点的文本时,只会触发此设置。如果我更改元素的属性或内联css样式,它不会被触发。为什么是这样?

回答