【网摘】监控 div 的内容变化
数据是动态加载而来,而当无数据时,提示一下暂无数据。而数据是可以动态在当前页面即时添加的,故在无数据时所做提示,需要隐藏,所以找了这个方法。成功在动态添加数据后,暂无数据的提示没有了。
if($(".comment-show").text() == ""){ $(".comment-show").html("<p class='comment-show-none'>暂无***</p>") } $(".comment-show").on("change",function(){ //数据容器,也是被监控的对象 console.log("change"); $(".comment-show-none").hide(); }); $(".pl-submit-btn").on("click",function(){ //动态添加数据的地方 $(".comment-show").change(); });

浙公网安备 33010602011771号