我正在爲我的一個項目的網站工作,我正在嘗試合併一些簡單的jQuery命令。他們似乎沒有工作。請通讀,讓我知道如果我失去了一些東西。jQuery命令不工作
HTML代碼:
<div class="button"> <a href="index.htm" class="a-top">Home</a></div>
<div class="button"> <a href="aboutus.htm" class="a-top">About us</a></div>
<div class="button"> <a href="contactus.htm" class="a-top">Contact us</a></div>
<div class="button-right" id="businesses"> <a href="forbusinesses.htm" class="a-top">For
businesses</a></div>
<div class="button-right"> <a href="forusers.htm" class="a-top">For users</a></div>
<div class="fluid-margin">
<div class="orange-body">
<div class="fake-header">
<img src="http://i879.photobucket.com/albums/ab358/dylanhusted/bulletnlogotranssmall_zpsa04c3fed .png" id="logo"/>
</div>
</div>
</div>
<div id="landing-page">
<div id="call-to-action">
<img src="https://scontent-b-lga.xx.fbcdn.net/hphotos-prn1/v/1608452_3821343707689_2110853534_n.jpg?oh=ab5ebfd5dce574e97a43e9a7c0739583&oe=52D0F2AC" id="learn-button"/>
</div>
<img src="https://scontent-b-lga.xx.fbcdn.net/hphotos-prn1/v/1551908_3821359708089_1101636385_o.jpg?oh=aa19a9ac5f5b5e4f3cf704858482803d&oe=52D11726"id="line"/>
</div>
<div class="footer">
<a href="index.htm" class="a-footer">Home</a>
<a href="aboutus.htm" class="a-footer">About Us</a>
<a href="contactus.htm" class="a-footer">Contact Us</a>
</div>
</body>
</html>
CSS代碼:
body {
background-color: #ffffff;
}
#landing-page {
width: 100%;
position:relative;
width:100%;
padding-bottom: 40%;
height:0;
overflow:hidden;
z-index: -1;
}
#line {
margin-left: 0;
margin-bottom: 0;
width: 100%;
}
.orange-body {
width: 70%;
z-index: -3;
border-radius: 5px;
margin: auto;
}
.fluid-margin {
position:relative;
width:100%;
padding-bottom:8%;
height:0;
overflow:hidden;
}
.fake-header {
width: 70%;
position: absolute;
border-radius: 5px;
margin-top: 1%;
margin-left: 15%;
z-index: -0;
}
#logo {
width: 28%;
height: 63%;
margin-top: .7%;
margin-left: 14%;
z-index: 1;
}
.button {
display: inline-block;
font-family: Trebuchet MS;
color: #8d8d8d;
font-size: 110%;
padding: 5px;
}
jQuery代碼:
$(document).ready(function() {
$('a').mouseover(function() {
(this).css("color", "#dfdbd8");
});
});
謝謝!
控制檯窗口中的任何錯誤? – Jason
如果這是你所有的HTML,你不包括jquery.js –
$(this).css(「color」,「#dfdbd8」);'你忘記'$'並且不要猶豫打開你的控制檯; ) –