开发者

swap jquery backgroundColor for background image?

A friend gave me a sol开发者_运维问答ution that uses this jquery code:

.css({ backgroundColor: '#ddd' })

Instead, i'd like to use a background image. How do I change the jquery code to do that?

I'm wanting to do something like

.css({ backgroundImg: 'images/newsletter-dropdown.jpg' })

Thanks!


Easy as pie:

$( element ).css({ 'background-color': 'transparent', 'background-image': 'images/newsletter-dropdown.jpg' });
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜