DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> CSS入門知識 >> CSS詳解 >> CSS+JS網頁制作實例:新聞列表鼠標滑過顯示詳情
CSS+JS網頁制作實例:新聞列表鼠標滑過顯示詳情
編輯:CSS詳解     
文章簡介:新聞列表鼠標滑過,顯示單條詳情.

<!DOCTYPE Html>
<Html>
<head>
<meta http-equiv="Content-Type" content="text/Html; charset=utf-8" />
<title>demo</title>
<style type="text/CSS">
body { font-size:12px; }
ul, h2, p { margin:0; padding:0; }
.list { list-style:none; width:400px; position:relative; vertical-align:middle; }
.list li { border-bottom:solid 1px #eee; cursor:default; position:relative; width:100%; }
.list h2 { font-size:100%; font-weight:normal; padding:.5em;}
.list span { position:absolute; right:1em; top:.5em; font-family:Verdana; font-size:90%;}
.list div { display:none; position:relative; height:70px; }
.list div img { float:left; margin:.8em 1em; background:#6FF; }
.list div p { padding:.8em; font-size:11px;}
.list div p strong { display:block; margin-bottom:.5em; }
.list li:hover, .list li.hover { height:auto; }
.list li:hover div, .list li.hover div { display:block; }
.list li:hover h2, .list li.hover h2, .list li:hover span, .list li.hover span { background:#5B86BB; color:#fff; }
</style>
<script type="text/Javascript" src="http://ajax.googleapis.com/AJax/libs/jquery/1.7.2/jquery.min.JS"></script>
</head>
<body>
<ul class="list" id="demo">
<li>
<h2>酷玩族手機</h2>
<span>2013-03-15</span>
<div> <img src=/School/UploadFiles_7810/201603/20160324115009983.gif" alt="" width="100" height="50" />
<p><strong>酷玩族手機</strong>iOS6.1完美越獄-安卓軟件園-android手機平板安卓軟件下載-安卓rom刷機教程-ROM固件包下載-游戲下載-主題壁紙下載</p>
</div>
</li>
<li>
<h2>酷玩族手機</h2>
<span>2013-03-15</span>
<div> <img src=/School/UploadFiles_7810/201603/20160324115009983.gif" alt="" width="100" height="50" />
<p><strong>酷玩族手機</strong>iOS6.1完美越獄-安卓軟件園-android手機平板安卓軟件下載-安卓rom刷機教程-ROM固件包下載-游戲下載-主題壁紙下載</p>
</div>
</li>
<li>
<h2>酷玩族手機</h2>
<span>2013-03-15</span>
<div> <img src=/School/UploadFiles_7810/201603/20160324115009983.gif" alt="" width="100" height="50" />
<p><strong>酷玩族手機</strong>iOS6.1完美越獄-安卓軟件園-android手機平板安卓軟件下載-安卓rom刷機教程-ROM固件包下載-游戲下載-主題壁紙下載</p>
</div>
</li>
<li>
<h2>酷玩族手機</h2>
<span>2013-03-15</span>
<div> <img src=/School/UploadFiles_7810/201603/20160324115009983.gif" alt="" width="100" height="50" />
<p><strong>酷玩族手機</strong>iOS6.1完美越獄-安卓軟件園-android手機平板安卓軟件下載-安卓rom刷機教程-ROM固件包下載-游戲下載-主題壁紙下載</p>
</div>
</li>
<li>
<h2>酷玩族手機</h2>
<span>2013-03-15</span>
<div> <img src=/School/UploadFiles_7810/201603/20160324115009983.gif" alt="" width="100" height="50" />
<p><strong>酷玩族手機</strong>iOS6.1完美越獄-安卓軟件園-android手機平板安卓軟件下載-安卓rom刷機教程-ROM固件包下載-游戲下載-主題壁紙下載</p>
</div>
</li>
<li>
<h2>酷玩族手機</h2>
<span>2013-03-15</span>
<div> <img src=/School/UploadFiles_7810/201603/20160324115009983.gif" alt="" width="100" height="50" />
<p><strong>酷玩族手機</strong>iOS6.1完美越獄-安卓軟件園-android手機平板安卓軟件下載-安卓rom刷機教程-ROM固件包下載-游戲下載-主題壁紙下載</p>
</div>
</li>
<li>
<h2>酷玩族手機</h2>
<span>2013-03-15</span>
<div> <img src=/School/UploadFiles_7810/201603/20160324115009983.gif" alt="" width="100" height="50" />
<p><strong>酷玩族手機</strong>iOS6.1完美越獄-安卓軟件園-android手機平板安卓軟件下載-安卓rom刷機教程-ROM固件包下載-游戲下載-主題壁紙下載</p>
</div>
</li>
</ul>
<script type="text/Javascript">
$(function() {
if ($("#demo li").length > 0) {
$("#demo li").eq(0).addClass("hover");
$("#demo li").mouseenter(function() {
$(this).siblings(".hover").removeClass("hover").end().addClass("hover");
});
}
});
</script>
</body>
</Html>

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved