解决了。
现场演示:http: //jsfiddle.net/oscarj24/Yh7pE/9/
$(function(){
$("#banner").addClass("light");
$("#change").on("click", function(e){
$("#banner").toggleClass("light").hide().toggleClass("dark").fadeIn();
e.preventDefault();
});
});
CSS:
.light {
background: url(http://oursaviorschurch.com/img/bg_banner.jpg) #ffffff;
opacity: 0.30; /* FX, Safari, GC, Opera, decent browsers */
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; /* IE8 */
filter: alpha(opacity=30); /* IE */
/* in Safari, FX and Chrome add a fade transition */
-webkit-transition: opacity .25s linear .1s;
transition: opacity .25s linear .1s;
}
.dark {
background: url(http://oursaviorschurch.com/img/bg_banner_dark.jpg) #000000;
opacity: 1; /* FX, Safari, GC, Opera, decent browsers */
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; /* IE8 */
filter: alpha(opacity=100); /* IE */
}