首页 > Web开发 > 详细

js代码片段

时间:2015-09-24 12:49:21      阅读:238      评论:0      收藏:0      [点我收藏+]
//解析xml
var 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) });

 

js代码片段

原文:http://www.cnblogs.com/yaoyao66123/p/4834763.html

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