获得CSS样式里资源地址
xiyuetaCSS().getsrc()属性方法,四种调用方式:
1、xiyuetaCSS(".nav").getsrc(); //获得CSS样式资源地址
2、xiyuetaCSS(".nav").getsrc("server=http://xiyueta.com/images/"); //获得处理后完整地址
3、xiyuetaCSS(".nav").getsrc("dir=../images/"); //获得处理目录后的地址
3、xiyuetaCSS(".nav").getsrc("filename"); //获得文件名称
总结:xiyuetaCSS().getsrc()用法为旧版,对像图片里有,号不处理,如 src: url( ' ../font/a,b,cd,,d,d,d,iconfont.eot?v=256 '); 可以使用xiyuetaCSS().getsrcarr()方法
尝试一下>>
<script src="https://www.xiyueta.com/js/xiyueta.min.js"></script> <script>
xiyuetaCSS().parse("div{color:red}div{color : blu e}div{color:green}.gds{getsrc:url( '/img/xiyueta.jpg ' );color:red}"); console.log(xiyuetaCSS("(all)").getsrc());
</script>
/img/xiyueta.jpg