我刚刚尝试了这个示例,并且在 IE6 中同时淡入和淡出工作:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$(document.body).click(function () {
$("div#one").fadeOut("slow");
$("div#two").fadeIn("slow");
});
});
</script>
<style>
span { color:red; cursor:pointer; }
div { margin:3px; width:80px; display:none;
height:80px; float:left; }
div#one { background:#f00; display:block;}
div#two { background:#0f0; }
div#three { background:#00f; }
</style>
</head>
<body>
<span>Click here...</span>
<div id="one"></div>
<div id="two"></div>
<div id="three"></div>
</body>
</html>
我修改了示例:http ://docs.jquery.com/Effects/animate#paramsoptions
我之前已经注意到,在实际 div 中而不是在 css 文件中或通过 jquery 将样式显示设置为 none 有时会导致问题。尝试只给每个 div 一个 displaynone 类,而不是设置它们的样式标签。希望这会有所帮助,祝你好运!