程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> PHP導航下拉菜單的實現如此簡單

PHP導航下拉菜單的實現如此簡單

編輯:關於PHP編程

復制代碼 代碼如下:
<style>
#sddm li a:hover
{ background: #49A3FF}

#sddm div
{ position: absolute;
visibility: hidden;
margin: 0;
padding: 0;
background: #EAEBD8;
border: 1px solid #5970B2}

#sddm div a
{ position: relative;
display: block;
margin: 0;
padding: 5px 10px;
width: auto;
white-space: nowrap;
text-align: left;
text-decoration: none;
background: #EAEBD8;
color: #2875DE;
font: 12px arial}

#sddm div a:hover
{ background: #49A3FF;
color: #FFF}
</style>
<!-- dd menu -->
<script type="text/javascript">
<!--
var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;

// open hidden layer
function mopen(id)
{
// cancel close timer
mcancelclosetime();

// close old layer
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

// get new layer and show it
ddmenuitem = document.getElementById(id);
ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
if(closetimer)
{
window.clearTimeout(closetimer);
closetimer = null;
}
}

// close layer when click-out
document.onclick = mclose;
// -->
</script>
<div class="header_continer002">

<div class="header"> <img class="logo" src="images/logo.jpg" /> <span class="pos_01">服務熱線<br />
400-691-6006</span> <span class="pos_02"> <a href="http://u.youku.com/user_show/id_UMzMxNDI5MTgw.html" target="_blank"><img src="images/top_pic01.jpg" /></a>

<div > <a href="http://weibo.com/tcdd" target="_blank"><img src="images/top_pic02.jpg" /></a></div>
</span>
<ul class="nav" onmouseout="hide_sub()" id="sddm">
<li><a href="/">首頁</a></li>

<li><a href="/plus/list.php?tid=1" onmouseover="mopen('m1')" onmouseout="mclosetime()">關於我們</a>
<div id="m1" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">
<a href="#">HTML DropDown</a>
<a href="#">DHTML DropDown menu</a>
<a href="#">JavaScript DropDown</a>
<a href="#">DropDown Menu</a>
<a href="#">CSS DropDown</a>
</div>
</li>

<li><a href="/plus/list.php?tid=2" onmouseover="mopen('m2')" onmouseout="mclosetime()">新聞中心</a>
<div id="m2" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">
<a href="#">ASP Dropdown</a>
<a href="#">Pulldown menu</a>
<a href="#">AJAX dropdown</a>
<a href="#">DIV dropdown</a>
</div>
</li>

<li><a href="/plus/list.php?tid=3" onmouseover="mopen('m3')" onmouseout="mclosetime()">解決方案</a>
<div id="m3" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">
<a href="#">ASP Dropdown</a>
<a href="#">Pulldown menu</a>
<a href="#">AJAX dropdown</a>
<a href="#">DIV dropdown</a>
</div>
</li>

<li><a href="/plus/list.php?tid=4" onmouseover="mopen('m4')" onmouseout="mclosetime()">產品展示</a>
<div id="m4" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">
<a href="#">ASP Dropdown</a>
<a href="#">Pulldown menu</a>
<a href="#">AJAX dropdown</a>
<a href="#">DIV dropdown</a>
</div>
</li>

<li><a href="/plus/list.php?tid=5" onmouseover="mopen('m5')" onmouseout="mclosetime()">支持與下載</a>
<div id="m5" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">
<a href="#">ASP Dropdown</a>
<a href="#">Pulldown menu</a>
<a href="#">AJAX dropdown</a>
<a href="#">DIV dropdown</a>
</div>
</li>

<li><a href="/plus/list.php?tid=6" onmouseover="mopen('m6')" onmouseout="mclosetime()">人才招聘</a>
<div id="m6" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">
<a href="#">ASP Dropdown</a>
<a href="#">Pulldown menu</a>
<a href="#">AJAX dropdown</a>
<a href="#">DIV dropdown</a>
</div>
</li>

<li><a href="/plus/list.php?tid=7" onmouseover="mopen('m7')" onmouseout="mclosetime()">聯系我們</a>
<div id="m7" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">
<a href="#">ASP Dropdown</a>
<a href="#">Pulldown menu</a>
<a href="#">AJAX dropdown</a>
<a href="#">DIV dropdown</a>
</div>
</li>
</ul>
</dl>
</div>
</div>
</div>

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved