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' });
精彩评论