纯CSS实现手风琴效果1:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>list</title>
<style>
*{ margin: 0;padding: 0;font-size: 15px; }
.list{width: 400px; height: 180px;border: 1px solid #000;}
.title{height: 30px; background: rgba(204, 202, 204, 0.56); padding-left: 10px; line-height: 30px;}
ul li{list-style: none;padding-left: 10px;border-bottom: 1px dotted #000000;line-height: 30px;color: darkslateblue; }
span{width: 25px;height: 25px;background-color: red;display: inline-block;text-align: center; line-height: 25px;}
ul li dl {padding-left: 37px;display: none; }
ul li:hover dl{display: block; }
</style>
</head>
<body>
<div class="list">
<h3 class="title">阅读排行</h3>
<ul>
<li><span></span>舌尖上的中国:传世美味完全攻略
<dl>
<dt>舌尖上的中国</dt>
<dd>作者:本书编写组</dd>
<dd>价格:</dd>
</dl></li>
<li><span></span>完全图解狗的心理</li>
<li><span></span>左手婚姻,右手爱情</li>
<li><span></span>假如给我三天光明(电子书)</li>
</ul>
</div>
</body>
</html>
纯CSS实现手风琴效果2:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>list</title>
<style>
*{ margin: 0;padding: 0;font-size: 15px; }
.list{width: 400px; height: 180px;border: 1px solid #000;}
.title{height: 30px; background: rgba(204, 202, 204, 0.56); padding-left: 10px; line-height: 30px;}
ul li{list-style: none;padding-left: 10px;border-bottom: 1px dotted #000000;line-height: 30px;color: darkslateblue; }
span{width: 25px;height: 25px;background-color: red;display: inline-block;text-align: center; line-height: 25px;}
ul li dl {padding-left: 37px;display: none; }
</style>
</head>
<body>
<div class="list">
<h3 class="title">阅读排行</h3>
<ul>
<li onmouseover="document.getElementById('detail').style.display='block'"
onmouseout="document.getElementById('detail').style.display='none'">
<span></span>舌尖上的中国:传世美味完全攻略
<dl id="detail">
<dt>舌尖上的中国</dt>
<dd>作者:本书编写组</dd>
<dd>价格:</dd>
</dl></li>
<li><span></span>完全图解狗的心理</li>
<li><span></span>左手婚姻,右手爱情</li>
<li><span></span>假如给我三天光明(电子书)</li>
</ul>
</div>
</body>
</html>
js实现手风琴效果3:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>list</title>
<style>
*{ margin: 0;padding: 0;font-size: 15px; }
.list{width: 400px; height: 180px;border: 1px solid #000;}
.title{height: 30px; background: rgba(204, 202, 204, 0.56); padding-left: 10px; line-height: 30px;}
ul li{list-style: none;padding-left: 10px;border-bottom: 1px dotted #000000;line-height: 30px;color: darkslateblue; }
span{width: 25px;height: 25px;background-color: red;display: inline-block;text-align: center; line-height: 25px;}
ul li dl {padding-left: 37px;display: none; }
</style>
<script type="text/javascript">
function showdetail() {
document.getElementById('detail').style.display = 'block';
}
function hidedatail() {
document.getElementById('detail').style.display = 'none';
}
</script>
</head>
<body>
<div class="list">
<h3 class="title">阅读排行</h3>
<ul>
<li onmouseover="showdetail()" onmouseout="hidedatail()">
<span></span>舌尖上的中国:传世美味完全攻略
<dl id="detail">
<dt>舌尖上的中国</dt>
<dd>作者:本书编写组</dd>
<dd>价格:</dd>
</dl></li>
<li><span></span>完全图解狗的心理</li>
<li><span></span>左手婚姻,右手爱情</li>
<li><span></span>假如给我三天光明(电子书)</li>
</ul>
</div>
</body>
</html>
js实现手风琴效果4:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>list</title>
<style>
*{ margin: 0;padding: 0;font-size: 15px; }
.list{width: 400px; height: 180px;border: 1px solid #000;}
.title{height: 30px; background: rgba(204, 202, 204, 0.56); padding-left: 10px; line-height: 30px;}
ul li{list-style: none;padding-left: 10px;border-bottom: 1px dotted #000000;line-height: 30px;color: darkslateblue; }
span{width: 25px;height: 25px;background-color: red;display: inline-block;text-align: center; line-height: 25px;}
ul li dl {padding-left: 37px;display: none; }
</style>
<script type="text/javascript">
function showdetail(d) {
document.getElementById(d).style.display = 'block';
}
function hidedetail(d) {
document.getElementById(d).style.display = 'none';
}
</script>
</head>
<body>
<div class="list">
<h3 class="title">阅读排行</h3>
<ul>
<li onmouseover="showdetail('detail')" onmouseout="hidedetail('detail')">
<span></span>舌尖上的中国:传世美味完全攻略
<dl id="detail">
<dt>舌尖上的中国</dt>
<dd>作者:本书编写组</dd>
<dd>价格:</dd>
</dl></li>
<li><span></span>完全图解狗的心理</li>
<li><span></span>左手婚姻,右手爱情</li>
<li><span></span>假如给我三天光明(电子书)</li>
</ul>
</div>
</body>
</html>
js实现手风琴效果5:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>list</title>
<style>
*{ margin: 0;padding: 0;font-size: 15px; }
.list{width: 400px; height: 180px;border: 1px solid #000;}
.title{height: 30px; background: rgba(204, 202, 204, 0.56); padding-left: 10px; line-height: 30px;}
ul li{list-style: none;padding-left: 10px;border-bottom: 1px dotted #000000;line-height: 30px;color: darkslateblue; }
span{width: 25px;height: 25px;background-color: red;display: inline-block;text-align: center; line-height: 25px;}
ul li dl {padding-left: 37px;display: none; }
</style>
</head>
<script type="text/javascript">
function showdetail(obj) {
obj.getElementsByTagName('dl')[0].style.display = 'block';
}
function hidedetail(obj) {
obj.getElementsByTagName('dl')[0].style.display = 'none';
}
<body>
<div class="list">
<h3 class="title">阅读排行</h3>
<ul>
<li onmouseover="showdetail(this)" onmouseout="hidedetail(this)">
<span></span>舌尖上的中国:传世美味完全攻略
<dl>
<dt>舌尖上的中国</dt>
<dd>作者:本书编写组</dd>
<dd>价格:</dd>
</dl>
<dl>
<dt>舌尖上的中国ren</dt>
<dd>作者:本书编写组</dd>
<dd>价格:</dd>
</dl></li>
<li onmouseover="showdetail(this)" onmouseout="hidedetail(this)"><span></span>完全图解狗的心理
<dl>
<dt>舌尖上的中国舌尖中国</dt>
<dd>作者:本书编写组</dd>
<dd>价格:</dd>
</dl></li>
<li><span></span>左手婚姻,右手爱情</li>
<li><span></span>假如给我三天光明(电子书)</li>
</ul>
</div>
</body>
</html>
jquery实现手风琴效果:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>list</title>
<style>
*{ margin: 0;padding: 0;font-size: 15px; }
.list{width: 400px; height: 180px;border: 1px solid #000;}
.title{height: 30px; background: rgba(204, 202, 204, 0.56); padding-left: 10px; line-height: 30px;}
ul li{list-style: none;padding-left: 10px;border-bottom: 1px dotted #000000;line-height: 30px;color: darkslateblue; }
span{width: 25px;height: 25px;background-color: red;display: inline-block;text-align: center; line-height: 25px;}
ul li dl {padding-left: 37px;display: none; }
</style>
<script src="jquery-3.1.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#li').mouseover(function () {
$('#detail').css('display','block');
})
$('#li').mouseout(function () {
$('#detail').css('display','none');
})
})
</script>
</head>
<body>
<div class="list">
<h3 class="title">阅读排行</h3>
<ul>
<li id="li">
<span></span>舌尖上的中国:传世美味完全攻略
<dl id="detail">
<dt>舌尖上的中国</dt>
<dd>作者:本书编写组</dd>
<dd>价格:</dd>
</dl></li>
<li><span></span>完全图解狗的心理</li>
<li><span></span>左手婚姻,右手爱情</li>
<li><span></span>假如给我三天光明(电子书)</li>
</ul>
</div>
</body>
</html>
jquery实现手风琴效果7:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>list</title>
<style>
*{ margin: 0;padding: 0;font-size: 15px; }
.list{width: 400px; height: 180px;border: 1px solid #000;}
.title{height: 30px; background: rgba(204, 202, 204, 0.56); padding-left: 10px; line-height: 30px;}
ul li{list-style: none;padding-left: 10px;border-bottom: 1px dotted #000000;line-height: 30px;color: darkslateblue; }
span{width: 25px;height: 25px;background-color: red;display: inline-block;text-align: center; line-height: 25px;}
ul li dl {padding-left: 37px;display: none; }
</style>
<script src="jquery-3.1.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('li').mouseover(function () {
$(this).children('dl').css('display','block');
$(this).children('span').addClass('on');
})
$('li').mouseout(function () {
$(this).children('dl').css('display','none');
$(this).children('span').removeClass('on');
})
})
</script>
</head>
<body>
<div class="list">
<h3 class="title">阅读排行</h3>
<ul>
<li id="li">
<span></span>舌尖上的中国:传世美味完全攻略
<dl id="detail">
<dt>舌尖上的中国</dt>
<dd>作者:本书编写组</dd>
<dd>价格:</dd>
</dl></li>
<li><span></span>完全图解狗的心理</li>
<li><span></span>左手婚姻,右手爱情</li>
<li><span></span>假如给我三天光明(电子书)</li>
</ul>
</div>
</body>
</html>