我需要你的幫助。我查看了所有的教程,但無法弄清楚我做錯了什麼。我希望藍色方塊淡出50%的不透明度。我已經嘗試過使用fadeTo,但無論使用什麼命令,它都不起作用。我需要做什麼。我的錯誤在哪裏?非常感謝!淡出到50%不起作用
<script type="text/javascript" src="jquery-1.8.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#divA").mouseover(function(){$("#divB").fadeTo('slow', 0.5, function());
$("#divA").mouseout(function(){$("#divB").fadeTo('slow', 1, function());
});
</script>
<style type="text/css">
#divA { background:red; width:25px; height:25px; margin:50px }
#divB { background:blue; width:200px; height:200px }
</style>
</head>
<body>
Hover over the red square to fadeout the blue one to 50% opacity.<br>
The blue square fades back in when your cursor leaves the red one.
<div id="divA"></div>
<div id="divB"></div>
</body>
</html>
你缺乏一個右括號。 – mddw