0731-55587844
其他(360、58、霸屏、搜狗、小程序)等代理合作請發(fā)郵箱254596208@qq.com
站內(nèi)公告:  如果您有其它業(yè)務(wù)聯(lián)系,請發(fā)郵件至yaner@y1web.com郵箱,謝謝您的配合!
營銷型網(wǎng)站建設(shè)第一品牌——優(yōu)度網(wǎng)絡(luò)
現(xiàn)在的位置:首頁 > 發(fā)布營銷型網(wǎng)站建設(shè) > 新聞資訊 > CSS制作文字滑動(dòng)菜單
CSS制作文字滑動(dòng)菜單
信息來源:優(yōu)度網(wǎng)絡(luò)  發(fā)布日期:2009/4/4 瀏覽數(shù)量:895
文章導(dǎo)讀:
<!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=gb2312" />
<title>建站學(xué)-www.jzxue.com</title>
</head>
<style type="text/css">
<!--
body,div,ul,li,p,h1,h2{ margin:0; padding:0; border:0; background:#FAFAFA; font-family:Arial, Helvetica, sans-serif,"宋體"}
body{ text-align:center; font-size:12px}
li{ list-style:none}
.rolinList{ width:402px; height:auto; margin:20px auto 0 auto; text-align:left}
.rolinList li{margin-bottom:1px;border:1px solid #DADADA}
.rolinList li h2{ width:380px; height:40px;  background:#fff; font-size:14px; line-height:40px; padding-left:20px; color:#333; cursor:pointer}
.content{ height:150px;width:400px;  background:#fff;  background:#FAFAFA}
.content p{ margin:12px}
-->
</style>
<script type="text/javascript">
//<![CDATA[
window.onload = function() {
rolinTab("rolin")
}
function rolinTab(obj) {
var list = $(obj).getElementsByTagName("LI");
var state = {show:false,hidden:false,showObj:false};
for (var i=0; i<list.length; i++) {
var tmp = new rolinItem(list[i],state);
if (i == 0) tmp.pShow();
}
}
function rolinItem(obj,state) {
var speed = 0.0666;
var range = 1;
var interval;
var tarH;
var tar = this;
var head = getFirstChild(obj);
var content = getNextChild(head);
var isOpen = false;
this.pHidden = function() {
if (isOpen) hidden();
}
this.pShow = show;
var baseH = content.offsetHeight;
content.style.display = "none";
var isOpen = false;
head.onmouseover = function() {
this.style.background = "#EFEFEF";
}
head.onmouseout = mouseout;
head.onclick = function() {
this.style.background = "#EFEFEF";
if (!state.show && !state.hidden) {
if (!isOpen) {
head.onmouseout = null;
show();
} else {
hidden();
}
}
}
function mouseout() {
this.style.background = "#FFF"
}
function show() {
head.style.borderBottom = "1px solid #DADADA";
state.show = true;
if (state.openObj && state.openObj != tar ) {
state.openObj.pHidden();
}
content.style.height = "0px";
content.style.display = "block";
content.style.overflow = "hidden";
state.openObj = tar;
tarH = baseH;
interval = setInterval(move,10);
}
function showS() {
isOpen = true;
state.show = false;
}
function hidden() {
state.hidden = true;
tarH = 0;
interval = setInterval(move,10);
}
function hiddenS() {
head.style.borderBottom = "none";
head.onmouseout = mouseout;
head.onmouseout();
content.style.display = "none";
isOpen = false;
state.hidden = false;
}
function move() {
var dist = (tarH - content.style.height.pxToNum())*speed;
if (Math.abs(dist) < 1) dist = dist > 0 ? 1: -1;
content.style.height = (content.style.height.pxToNum() + dist) + "px";
if (Math.abs(content.style.height.pxToNum() - tarH) <= range ) {
clearInterval(interval);
content.style.height = tarH + "px";
if (tarH != 0) {
showS()
} else {
hiddenS();
}
}
}
}
var $ = function($) {return document.getElementById($)};
String.prototype.pxToNum = function() {return Number(this.replace("px",""))}
function getFirstChild(obj) {
var result = obj.firstChild;
while (!result.tagName) {
result = result.nextSibling;
}
return result;
}
function getNextChild(obj) {
var result = obj.nextSibling;
while (!result.tagName) {
result = result.nextSibling;
}
return result;
}
//]]>
</script>
<body>
<ul class="rolinList" id="rolin">
<li>
<h2>花郎徒結(jié)</h2>
<div class="content"><p>當(dāng)時(shí)明月在,曾照彩云歸<br /><br />
倦了紅顏,憔悴為千年,幾多情深夜語,一點(diǎn)聽風(fēng)悠然。<br />
村憶夢回,飄逸如煙,友別憐影單。<br />
而今沙漠風(fēng)閑,雪原清冷,東海云淡,石谷誰惜緣。<br />
累了心間,問也還煩,都道風(fēng)沙淘盡,何日再慰別緣! </p></div>
</li>
<li>
<h2>帝王槌</h2>
<div class="content"><p>立劍賞月意惆悵,袖飾刀,衣披霜,傲視霧丸,徒手戰(zhàn)扶桑.<br />
問津終尋帝王陵,黑影沒,尸滿崗,惟見逆鯪露寒光.  <br />
須發(fā)蒼,氣軒昂,三尺銀狼,破風(fēng)動(dòng)八方.  <br />
依身緊握噬魂槍,飲虎血,豪萬丈.惟有千年我故鄉(xiāng)!</p></div>
</li>
<li>
<h2>玉女槍法</h2>
<div class="content"><p>曾經(jīng)有個(gè)夢想:馳騁江湖,快意恩仇。<br />
曾經(jīng)有份愿望:千里追兇,十步濺血。<br />
曾經(jīng)有腔豪情:奇功蓋世,名冠武林。<br />
曾經(jīng)有種期盼:燭影搖紅,衣袖添香。</p></div>
</li>
<li>
<h2>黑沙剛體</h2>
<div class="content"><p>趙客縵胡纓,吳鉤霜雪明。銀鞍照白馬,颯沓如流星。 <br />
十步殺一人,千里不留行。事了拂衣去,深藏身與名。 <br />
閑過信陵飲,脫劍膝前橫。將炙啖朱亥,持觴勸侯嬴。 <br />
三杯吐然諾,五岳倒為輕。眼花耳熱后,意氣素霓生。 <br />
救趙揮金錘,邯鄲先震驚。千秋二壯士,烜赫大梁城。 <br />
縱死俠骨香,不慚世上英。誰能書閣下,白首太玄經(jīng)。</p>
</div>
</li>
<li>
<h2>不羈浪人槍</h2>
<div class="content"><p>素手相牽,斜輝入眼簾,一輪逍遙自在間,醉了山水閑。<br />
沙漠綠水漣,魚游淺底,明眸一水天。<br />
愛在村友相談,開心點(diǎn)點(diǎn),笑語連連,率性夜無眠。<br />
月在西邊,風(fēng)亂星寒,輾轉(zhuǎn)醇香舊事,蛾兒曼舞燈前。</p></div>
</li>
<li>
<h2>霧水掌</h2>
<div class="content"><p>蹄影善奔,如幻如魔,其皮傳世,絕學(xué)再現(xiàn),<br />
又有誰在這殘陽道中追逐它的身影... </p>
</div>
</li>
</ul>
</body>
</html>
相關(guān)信息
  • 網(wǎng)絡(luò)營銷培訓(xùn)
  • 微網(wǎng)站
  • 掃二維碼
  • 1
  • 2
  • 3
  • 最新上傳
  • 精品案例
  • 自動(dòng)流水線嘉
  • 湖南省湘江重
  • 湘潭家居\建
  • 湘潭學(xué)校微網(wǎng)