【小知识】 jquery设置背景图片

 jquery设置背景图片时css

设置为java

$(this).css("background-image","on.jpg");

这个是不起做用的,要改成:jquery

$(this).css("background-image","url(on.jpg)");

添加上URL,若是须要其余参数直接加上就行。this

如:
url

$("strong").css("background","url(/static/payplug/img/msg_red.jpg) 
left center no-repeat");

就能够了code

相关文章
相关标签/搜索