我在使用jQuery中的fadeTo()函數時遇到了麻煩。這一切都在我開始工作,但它現在停止工作,原因不明。在這裏,我介紹你的網頁代碼。如果你能幫助我,我將不勝感激。fadeTo()不起作用
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="css/subscribe.css" />
<script type="text/javascript" src="js/jQuery.js"></script>
<script>
$(document).ready(function(){
subscribe = function(){
\t $('#subscribe').fadeTo(500,1);
};
});
</script>
</head>
<body style="background:#fff;">
<a href="#" id="plus" onClick="subscribe();">+</a>
<div id="subscribe" style="opacity:0;"><?php include('subscribe.php'); ?></div>
<!--<video id="bgvid" width="100%" height="100%" style="position:absolute;opacity:1;" autoplay loop muted>
<source src="css/7dayz.mp4" type="video/mp4"></video>-->
<div id="wrapper_main" style="opacity:1;">
\t <div id="center_main">
\t \t <p><a href="#">LOOK</a></p>
\t \t <p><a href="#">SHOP</a></p>
\t \t <p><a href="#">JOURNAL</a></p>
\t </div> \t
</div>
</body>
</html>
看起來不錯http://jsfiddle.net/arunpjohny/s5aqo31h/1/ - 嘗試使用jQuery的事件處理程序,而不是內嵌處理器 – 2015-02-10 11:01:37