Ok, I found out thanks to the jquery IRC channel.
It had to be url('/public/images/icons/slideDown.jpg')
Thank you.
debussy007 wrote:
>
> Hello !
>
> I am trying to change the background image of a div when clicking on an
> element.
> This is my code :
>
> [...]
> $('#accordion').css('background-image',
> '/public/images/icons/slideDown.jpg');
>
> alert($('#accordion').css('background-image'));
> [...]
>
> But the alert box will never show me the right url, it will only give me
> the initial url when the page was loaded, so the image is not changing.
>
> Can anyone help me with this ?
>
> Thank you for any help ! :-)
>
>
--
View this message in context:
http://www.nabble.com/Changing-a-background-image-with-.css%28%29-function-tf4665937s27240.html#a13328945
Sent from the jQuery General Discussion mailing list archive at Nabble.com.