Alrighty所以這裏是我當前的jquery代碼在DIV的懸停「fbox」通過改變類股利「fbot」jQuery的 - 添加淡入/淡出到懸停addclass功能
<script>
$(document).ready(function() {
$(function() {
$("#fbox").hover(function() {
$("#fbot").addClass("fboto");
},
function() {
$("#fbot").removeClass("fboto");
});
});
});
</script>
現在替換背景我想要的是將fadeIn和fadeOut添加到不斷變化的背景中,但我不確定正確的方法,我已經嘗試了一些不同的安排,它只是不按照我希望的方向或順序工作..
我的這些div的html:
<div id="fbox">
<div id="ftop"></div> <!-- top of fullbox -->
<!-- middle of fullbox -->
<div id="fmid">
<!-- content for the fullbox goes BELOW here -->
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- content for the fullbox goes ABOVE here -->
</div>
<!-- end middle of fullbox -->
<div id="fbot" class="fbot"></div> <!-- bottom of fullbox -->
</div>
我對背景圖像簡單的CSS改變..:
.fboto {
width: 934px;
background:url(images/cb/fboto.png) no-repeat;
height: 17px;
margin:0
}
任何幫助將是巨大的,謝謝!
似乎沒有成爲背景圖像之間褪色的方法;儘管如果你願意在你的標記中使用圖像,並設置風格來近似背景圖像,你可以使用「fadeIn」和「fadeOut」。 – 2010-12-12 15:35:39