您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

求教一个问题_html/css_WEB-ITnose

2024/12/23 23:13:26发布26次查看
$(.pe_xgtxb_r span).css(style,background:url(+json.path+'190x190'+json.localname+) no-repeat);
为什么没法给这个span导这个图片了json.path+'190x190'+json.localname拼出来是我图片的位置
回复讨论(解决方案) 恩
请单独定义拼接路径
var newurl= json.path+'190x190'+json.localname;alert(newurl);$(.pe_xgtxb_r span).css(background-image, newurl);
$(.pe_xgtxb_r span).attr(style,background:url(+json.path+'190x190'+json.localname+) no-repeat);
或者
$(.pe_xgtxb_r span).css({background-image:url(+json.path+'190x190'+json.localname+),background-repeat:no-repeat});
1楼2楼都好使
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product