我试图在页面加载时淡化文本,但由于某种原因,效果根本不起作用。 我不知道是不是因为jQuery / CSS出了问题,或者是因为我没有正确提取文件。
这里是HTML代码:
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="scripts.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div>
<div class="left-home">
<div class="left-container">
<div id="side-one">
<p>AquaMassage</p>
</div>
</div>
</div>
<div class="right-home">
<div class="right-container">
<div id="side2">
<p>Manicure Express</p>
</div>
<div class="main-button"><a href="google.com">Enter</a>
</div>
</div>
</div>
</div>
</body>
</html>
CSS:
body {
width:100%;
margin:0;
}
.left-home {
width:50%;
float:left;
background:#42C0FB;
height:963px;
}
.left-container {
width:60%;
margin:0 auto;
text-align:center;
}
.right-home {
width:50%;
float:right;
background:#FFF;
height:963px;
}
.right-container {
margin:0 auto;
width:65%;
text-align:center;
}
/*
Side One Below
*/
#side-one {
color:#000;
text-align: center;
}
#side-one p {
font-size:60px;
opacity: 0;
}
#side2 {
padding-top: 130px;
font-size:60px;
color:#F660AB;
}
.main-button {
margin-top:60%;
}
.main-button a {
background-color: #F660AB;
border: #F5409A;
border-bottom: 1px solid #F5409A;
-webkit-box-shadow: inset 0 1px 0 0 #F5409A;
box-shadow: inset 0 1px 0 0 #F5409A;
color: #fff;
padding: 6px 0 7px 0;
text-align: center;
width: 150px;
text-decoration: none;
padding-left: 10px;
padding-right: 10px;
font-size: 20px;
}
.main-button a:hover{
}
jQuery:
$(document).ready(function() {
$("#side-one p").delay(1000).animate({ opacity: 1 }, 700);
});
我似乎无法找到问题所在。真的很感激任何帮助!