【发布时间】:2013-11-29 23:47:06
【问题描述】:
我有一个DIV 样式为resize: both,然后我设置了一个MutationObserver 来监听属性的变化。
mutObs = new MutationObserver(function () {
console.log('Hello');
});
elem = document.getElementById('aDiv');
mutObs.observe(elem, {
attributes: true
});
elem.style.width = '300px'; //this fires the observer callback as expected
我做了一个小提琴:http://jsfiddle.net/2NQQu/2/
在 Chrome(我测试了 Chrome 31)中,当您使用鼠标调整 DIV 的大小时,不会触发回调。在 Firefox 中它工作正常。
这种行为是有意的和/或标准的吗?是bug吗?
【问题讨论】:
-
现在已修复。
标签: javascript html google-chrome resize mutation-observers