📜  来自更改样式的事件 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:17.230000             🧑  作者: Mango

代码示例1
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutationRecord) {
    console.log('style changed!');
   });    
 });

 var target = document.getElementById('myId');
  observer.observe(target, { attributes : true, attributeFilter : ['style'] });