我正在尝试淡化我网站背景上的一些图像,但无法正常工作 T_T 。提前致谢 !
HTML:
<body>
<div id="menu1"></div>
<div id="menu2"></div>
<div id="menu3"></div>
</body>
CSS:
body {
background-color: #1f304e;
background-image: url('images/bg.jpg');
background-repeat: no-repeat;
background-attachment:fixed;
background-position: center 0px;
}
查询:
$('#menu1').click(function(){
$(body).animate({background : url('images/bg1.jpg') }, 600);
});
$('#menu2').click(function(){
$(body).animate({background : url('images/bg2.jpg') }, 600);
});
$('#menu3').click(function(){
$(body).animate({background : url('images/bg3.jpg') }, 600);
});