div#bg {
position:fixed;
top:0;
left:0;
height:300px;
width:100%;
z-index:-10;
background-position:center 0;
background-repeat:no-repeat;
background-size:cover;
-webkit-background-size:cover;
-o-background-size:cover;
opacity:1;
transition:opacity 1s linear;
-moz-transition:opacity 1s linear;
-webkit-transition:opacity 1s linear;
-o-transition:opacity 1s linear;
}
通过背景的opacity来实现背景的隐藏显示从而实现背景图的切换