html5监控某个dom变化
var targetSecondNode = $(".secondList")[0];//要监控的dom对象 var obSecondServer = new MutationObserver(function (mutations) {
//dom变化回调的函数
$(".secondList .item-list div:first").addClass("active"); $(".secondList .item-list div:first").click(); }); obSecondServer.observe(targetSecondNode, { attributes: true, childList: true, subtree: true });
本文来自博客园,作者:沉迷编程的程序员,转载请注明原文链接:https://www.cnblogs.com/codeDevotee/p/12658735.html
欢迎各位找我代写程序,python、c#、web等都可以,加我请注明博客园微信:A15919195482