1
rated 0 times
[
5]
[
4]
/ answers: 1 / hits: 15350
/ 13 Years ago, wed, march 23, 2011, 12:00:00
I'm trying to save the background-image of a element, remove it and then maybe add it back later.
var current_bg_image = $(#div).css(background-image);
if(something){
$(#div).css(background-image, none);
}else{
$(#div).css(background-image, current_bg_image); // not working...
}
The part where the background image is supposed to be added back doesn't work...
But if I change current_bg_image
with url(something.jpg)
it works. It seems that css() doesn't work with variables?
More From » jquery