【发布时间】:2019-08-26 14:38:15
【问题描述】:
我在 jQuery 中使用 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(){
$('#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;">
<div id="center_main">
<p><a href="#">LOOK</a></p>
<p><a href="#">SHOP</a></p>
<p><a href="#">JOURNAL</a></p>
</div>
</div>
</body>
</html>
【问题讨论】:
-
看起来不错 jsfiddle.net/arunpjohny/s5aqo31h/1 - 尝试使用 jQuery 事件处理程序而不是内联处理程序
标签: javascript jquery fadeto