我想將我的第一個背景圖像淡入一個應該用於懸停的圖像,然後在用戶刪除它們的鼠標後再關閉。可以使用jQuery。從背景圖像淡出到懸停
這是我到目前爲止有:
<ul style="top: -70px; display: block; padding-left: 205px;" id="cats-menu" class="nav superfish sf-js-enabled">
<a href="http://www.ballpointtech.com/category/guides/"></a><li id="li_guides" onclick="window.location = 'http://www.ballpointtech.com/category/guides/';"><a href="http://www.ballpointtech.com/category/guides/"> </a></li>
<a href="http://www.ballpointtech.com/category/news/"></a><li id="li_news" onclick="window.location = 'http://www.ballpointtech.com/category/news/';"><a href="http://www.ballpointtech.com/category/news/"> </a></li>
<a href="http://www.ballpointtech.com/category/reviews/"></a><li id="li_reviews" onclick="window.location = 'http://www.ballpointtech.com/category/reviews/';"><a href="http://www.ballpointtech.com/category/reviews/"> </a></li>
<a href="http://www.ballpointtech.com/category/tipstricks/"></a><li id="li_tipstricks" onclick="window.location = 'http://www.ballpointtech.com/category/tipstricks/';"><a href="http://www.ballpointtech.com/category/tipstricks/"> </a></li>
</ul>
<style type="text/css">
#li_guides {
background-image:url('http://www.ballpointtech.com/wp-content/uploads/2010/09/Guides-Still1.png');
width:130px;
height:92px;
}
#li_guides:hover {
background-image:url('http://www.ballpointtech.com/wp-content/uploads/2010/09/Guides-Rollover1.png');
}
#li_guides:active {
background-image:url('http://www.ballpointtech.com/wp-content/uploads/2010/09/Guides-Click2.png');
}
#li_reviews {
background-image:url('http://www.ballpointtech.com/wp-content/uploads/2010/09/Reviews-Still.png');
width:130px;
height:92px;
}
#li_reviews:hover {
background-image:url('http://www.ballpointtech.com/wp-content/uploads/2010/09/Reviews-Rollover.png');
}
#li_reviews:active {
background-image:url('http://www.ballpointtech.com/wp-content/uploads/2010/09/Reviews-Click.png');
}
#li_news {
background-image:url('http://www.ballpointtech.com/wp-content/uploads/2010/09/News-Still.png');
width:130px;
height:92px;
}
#li_news:hover {
background-image:url('http://www.ballpointtech.com/wp-content/uploads/2010/09/News-Rollover.png');
}
#li_news:active {
background-image:url('http://www.ballpointtech.com/wp-content/uploads/2010/09/News-Click.png');
}
#li_tipstricks {
background-image:url('http://www.ballpointtech.com/wp-content/uploads/2010/09/tipstricks-still.png');
width:130px;
height:92px;
}
#li_tipstricks:hover {
background-image:url('http://www.ballpointtech.com/wp-content/uploads/2010/09/tipstricks-rollover.png');
}
#li_tipstricks:active {
background-image:url('http://www.ballpointtech.com/wp-content/uploads/2010/09/tipstricks-click.png');
}
</style>
哎呀,不能得到正確的格式...
太....很多...代碼... – 2010-09-22 17:03:45
只是一個想法,但http://jsbin.com是一個*精彩*的地方... =) – 2010-09-22 17:05:44