功能介绍
$(“id”).on(“DOMNodeInserted”,function(){})
可以实时监听页面上的文本变化,当文本变化时可以执行相应的操作
js脚本
$(document).ready(function(){
var point=$("#BA_767942762901787").width()
var pointheight=point/100
var width1=parseFloat($("#BA_701901384744369").text())*pointheight
extendwidth("#BA_626619857901611",width1)
function extendwidth(item,width){
if(width<point){
// alert("width1:"+width)
$(item).css("width","0px");
$(item).animate({
"width": width
},1000);
}else{
// alert("width2:"+width)
$(item).css("width","0px");
$(item).animate({
"width":"120%"
},1000);
}
}
$("#BA_701901384744369 span").on("DOMNodeInserted",function(){
var width1=parseFloat($("#BA_701901384744369").text())*pointheight
extendwidth("#BA_626619857901611",width1)
});
});
/*$("#BA_701901384744369 span").on("DOMNodeInserted",function(){
var width1=parseFloat($("#BA_701901384744369").text())*pointheight
extendwidth("#BA_626619857901611",width1)
});*/