开发者

formatting for concatenated string jquery

Hi I'm trying to get this

$( "<div class=\"images\ style=\"background:url('" + item.link + "')no-repeat top center;\"/>").appendTo("#images").wrap("<a target=\"_blank\ href='" + item.link + "'></a>");

to output correctly but I'm not very hot on concatenating javascript strings. It's the line 开发者_如何学运维background div I can't get right.

cheers

Andy


Try

$( "<div class='images' style='background:url(" + item.link + ")no-repeat top center;'/>").appendTo("#images").wrap("<a target='_blank' href=" + item.link + "></a>");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜