你好我第一次来这里
我有一个基本的 jQuery slideToggle,但它不起作用。任何解决方案?
感谢您阅读本文。
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style/style.css">
<script type="text/javascript" scr="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#ucp").click(function(){
$("#test").slideToggle("slow");
});
});
</script>
</head>
<body>
<div class="header">
<a href="http://www.kevinheisen.nl" target="_blank"><img src="style/lacp.png" alt="acp logo"></a>
<div class="nav">
<ul>
<li><a href="#">Afmelden</a></li>
<li><a href="http://www.kevinheisen.nl">Vraag hulp</a></li>
<li><a href="#">preview website</a></li>
<li><a href="#">ACP startpagina</a></li>
</ul>
</div>
</div>
<div id="ucp">Gebruikers beheer</div>
<div id="test">hallo hallo hallo hallo</div>
<div class="project">Projecten<br /><span id="menu">Klik hier om groter te maken</span></div>
<div class="updates">Updates<br /><span id="menu">Klik hier om groter te maken</span></div>
<div class="homecontent">Home content<br /><span id="menu">Klik hier om groter te maken</span></div>
<div class="portofolio">portfolio<br /><span id="menu">Klik hier om groter te maken</span></div>
<div class="about">Over mij<br /><span id="menu">Klik hier om groter te maken</span></div>
</body>
</html>
好的,这是我所有的代码。我知道我可以减少 CSS。
@font-face {
font-family: 'Acptitle';
src:url('/admin/style/CGFLocustResistance.ttf'),
url('/admin/style/CGFLocustResistance.eot'); /* IE9 */
}
@font-face {
font-family: 'Acpdefault';
src:url('/admin/style/ccaps.ttf'),
url('/admin/style/ccaps.eot'); /* IE9 */
}
body {
margin: 0px 0px 0px 0px;
padding: 0;
background: #585858;
background-image: url('/style/lacp.png');
}
#menu {
font-size: 8px;
}
.header {
height: 180px;
min-width: 960px;
width: 100%;
background: #3A3A3A;
}
img {
display: block;
margin: 0 auto;
text-align: center;
}
.header > .nav > ul {
list-style-type: none;
}
.header > .nav > ul > li {
font-family: 'Acptitle';
text-align: center;
}
.header > .nav > ul > li > a:link, a:visited{
font-size: 12px;
box-shadow: inset 0 0 20px #000000;
margin: 0 10px;
float: right;
display: block;
background: #3A3A3A;
border-radius: 20px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
height: 30px;
width: 150px;
padding: 15px;
color: black;
}
.header > .nav > ul > li > a:hover, a:active {
color: #000000;
background: #212121;
}
#ucp, #test{
font-family: 'Acptitle';
margin: 15px 0 0 5%;
width: 40%;
height: 45px;
float: left;
box-shadow: inset 0 0 20px #000000;
border-radius: 20px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
padding: 10px;
text-align: center;
}
#test{
display: none;
height: 300px;
width: 40%;
}
.project {
font-family: 'Acptitle';
margin: 15px 5% 0 0;
width: 40%;
height: 45px;
float: right;
box-shadow: inset 0 0 20px #000000;
border-radius: 20px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
padding: 10px;
text-align: center;
}
.updates {
font-family: 'Acptitle';
margin: 15px 5% 0 0;
width: 40%;
height: 45px;
float: right;
box-shadow: inset 0 0 20px #000000;
border-radius: 20px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
padding: 10px;
text-align: center;
}
.homecontent {
font-family: 'Acptitle';
margin: 15px 0 0 5%;
width: 40%;
height: 45px;
float: left;
box-shadow: inset 0 0 20px #000000;
border-radius: 20px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
padding: 10px;
text-align: center;
}
.portofolio {
font-family: 'Acptitle';
margin: 15px 0 0 5%;
width: 40%;
height: 45px;
float: left;
box-shadow: inset 0 0 20px #000000;
border-radius: 20px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
padding: 10px;
text-align: center;
}
.about {
font-family: 'Acptitle';
margin: 15px 5% 0 0;
width: 40%;
height: 45px;
float: right;
box-shadow: inset 0 0 20px #000000;
border-radius: 20px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
padding: 10px;
text-align: center;
}
这一切。我在其他网站上没有问题。我认为我的网站浏览器不是问题。我正在使用谷歌浏览器顺便说一句。我也在 IE9 和 Firefox 中尝试过。