首页 > Web开发 > 详细

html5监控某个dom变化

时间:2020-04-08 13:23:12      阅读:72      评论:0      收藏:0      [点我收藏+]
 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 });

 

html5监控某个dom变化

原文:https://www.cnblogs.com/codeDevotee/p/12658735.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!