日期:2014-05-16  浏览次数:20513 次

求jquery代码!
<div id="sidebar">
       <a class="bg1" href="#">&nbsp;</a>
       <hr/>
       <a class="bg2" href="#">&nbsp;</a>
       <hr/>
       <a class="bg3" href="#">&nbsp;</a>
       <hr/>
       <a class="bg4"href="#">&nbsp;</a>
       <hr/>
       <a class="bg5" href="#">&nbsp;</a>
       <hr/>
       <a class="bg6" href="#">&nbsp;</a>
       <hr/>
    </div>
这是代码,不同的行鼠标滑过和点击实现不同背景图片,并且,其他行还原 
js jQuery

------解决方案--------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<title>无标题文档</title>
<style type="text/css">
a{color:#333}
.bg1.focus{background-color:#666}
.bg2.focus{background-color:#999}
.bg3.focus{background-color:#ccc}
.bg4.focus{background-color:#f00}
.bg5.focus{background-color:#00FF00}
.bg6.focus{background-color:#0000FF}
</style>
</head>

<body>
<div id="sidebar">
       <a class="bg1" href="#">aaaaaaaaaaaaaa</a>
       <hr/>
       <a class="bg2" href="#">bbbbbbbbbbbb</a>
       <hr/>