//解析xmlvar sc = "<window left=‘0‘ top=‘0‘ right=‘500‘ bottom=‘300‘ ><item playinfotype=‘html‘ type=‘localfile‘ filename=‘ct_1399954818700.txt‘ entryeffect=‘no_effect‘ entryspeed=‘NORMAL‘ staytime=‘5‘ backgroundcolor=‘#000000‘ /></window>"; var xmlDoc = $.parseXML(sc); var result=""; $(xmlDoc).find("window").each(function(i) { var wleft = $(this).attr("left"); var wtop = $(this).attr("top"); var wright = $(this).attr("right"); var wbottom = $(this).attr("bottom"); var color = $(this).children("item").attr("backgroundcolor"); alert(color); // wleft:左边距 wtop:上边距:wright:宽 bottom:高 reduction(wleft,wtop,wright,wbottom) });
时间: 2024-10-06 17:21:41