admin管理员组文章数量:1392003
I have a DIV
with style resize: both
and then I set a MutationObserver
that listens for changes in attributes.
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
I made a fiddle: /
In Chrome (I tested Chrome 31) the callback is not fired when you resize the DIV
with the mouse. In Firefox it works fine.
Is this behavior intentional and/or standard? Is it a bug?
I have a DIV
with style resize: both
and then I set a MutationObserver
that listens for changes in attributes.
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
I made a fiddle: http://jsfiddle/2NQQu/2/
In Chrome (I tested Chrome 31) the callback is not fired when you resize the DIV
with the mouse. In Firefox it works fine.
Is this behavior intentional and/or standard? Is it a bug?
Share Improve this question edited Jun 1, 2014 at 17:28 Matt 75.3k26 gold badges156 silver badges180 bronze badges asked Nov 29, 2013 at 23:47 GetFreeGetFree 42.7k20 gold badges86 silver badges106 bronze badges 1- 1 It's now fixed. – cprcrack Commented May 17, 2017 at 13:44
1 Answer
Reset to default 7It is a bug in Chrome, reported here. The bug is still open, which means it has not been fixed.
本文标签: javascriptManually resizing an element doesn39t fire a mutation observer in ChromeStack Overflow
版权声明:本文标题:javascript - Manually resizing an element doesn't fire a mutation observer in Chrome - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744707680a2620938.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论