Get*_*ree 5 html javascript resize google-chrome mutation-observers
我有一个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
Run Code Online (Sandbox Code Playgroud)
我做了一个小提琴:http://jsfiddle.net/2NQQu/2/
在Chrome(我测试过Chrome 31)中,DIV使用鼠标调整大小时不会触发回调.在Firefox中它工作正常.
这种行为是故意的和/或标准的吗?这是一个错误吗?