I have this code :
if (pansel.val() == "1") $(#myDiv).css('background-image', 'url(/private_images/guida_check_category.jpg)'); else $(#myDiv).css({ 'background-color': '#ffffff' });
and I see that, when I apply the background-image, the follow code :
$(#myDiv).css({ 'background-color': '#ffffff' });
doesnt remove the image and put the white background color. The image still present!
How can I totally remove that background-image attribute?
Select the picture that you want to remove the background from. On the toolbar, select Picture Format > Remove Background, or Format > Remove Background. If you don't see Remove Background, make sure you have selected a picture.
The most common & simple way to add background image is using the background image attribute inside the <body> tag.
Try this:
if (pansel.val() == "1") $("#myDiv").css('background-image', 'url(/private_images/guida_check_category.jpg)'); else { $("#myDiv").css({ 'background-color': '#ffffff' }); $("#myDiv").css('background-image', 'none'); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With