Reputation: 133
I use jQuery fadeTo to get a transparent background of a DIV, but this also affects the content inside the DIV like text. Is there a way to only affect the background DIV and not the content?
Upvotes: 1
Views: 259
Reputation: 418
Or you can directly download the plugin at http://www.bitstorm.org/jquery/color-animation/
To use the plugin simply as example below:
$("#div").animate({backgroundColor: 'rgba(73, 47, 20, 0.6)'});
The sample rgba value above will generate: red value = 73, green value = 47, green value = 20, and alpha value = 0.6, the less the value, the transparent.
Upvotes: 1
Reputation: 23662
You can use
$("div").animate({background: "transparent"}, 1000);
You'll need the Color Animation plugin for that capability.
Upvotes: 1