tags:

views:

22

answers:

1

A friend gave me a solution 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!

+1  A: 

Easy as pie:

$( element ).css({ 'background-color': 'transparent', 'background-image': 'images/newsletter-dropdown.jpg' });
Jacob Relkin
hmm-doesn't work for me. Image property is getting dropped in firebug as well...
Joel
@Joel, updated.
Jacob Relkin
@Joel, did it work?
Jacob Relkin
@Jacob. I ended up finding a way to do it through css. That said, I still marked your answer as correct. Thanks!
Joel