每次我尝试将以下代码添加到我的网站时,<a href>
页面上的每个链接都会打开。如何在不打开每个<a href>
链接的情况下使此代码正常工作,而不是使用单击功能,我可以使用按钮及其 id 代替吗?
<!DOCTYPE html>
<html>
<head>
<style>
p.one { position:relative; width:400px; height:90px; }
div.two { position:absolute; width:400px; height:65px;
font-size:36px; text-align:center;
color:yellow; background:red;
padding-top:25px;
top:0; left:0; display:none; }
span.three { display:none; }
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<p class="one">
Let it be known that the party of the first part
and the party of the second part are henceforth
and hereto directed to assess the allegations
for factual correctness... (<a href="#">click!</a>)
<div class="two"><span class="three">Click here to continue...</span></div>
</p>
<script>
$("a").click(function () {
$("div").fadeIn(3000, function () {
$("span").fadeIn(100);
});
return false;
});
</script>
</body>
</html>