现在的位置: 首页 > 综合 > 正文

收藏一個網頁菜單的腳本

2013年12月12日 ⁄ 综合 ⁄ 共 3062字 ⁄ 字号 评论关闭
<!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>无标题文档</title>
        
<style type="text/css">
body 
{
margin: 36px 
0 20px 0;
background
-color: #fff;
text
-align: center;
}


a img 
{
border: none;
}


form 
{
margin: 
0;
padding: 
0;
}


.cleared 
{
clear: both;
line
-height: 0;
}


.clear 
{
clear: both;
}


table 
{
border
-collapse: collapse;
}


td 
{
vertical
-align: top;
}


#navBar 
{
background
-color: #303030;
margin: 2px 
0 0 0;
height: 30px;
}


#navBar ul li 
{
list
-style-type: none;
display: block;
float: left;
}


#navBar ul li a 
{
color: #d6d6d6;
border
-right: 1px solid #fff;
}


#navBar ul li a:hover 
{
background
-color: #415166;
color: #fff;
text
-decoration: none;
}


#bodyContent 
{
background: url(..
/images/2col_bg.gif) top center repeat-y;
padding: 
0 20px;
}


#bodyContent a 
{
font
-weight: bold;
}


/* Dropdowns */

#nav, #nav ul 
{
padding: 
0;
margin: 
0;
list
-style: none;
}



#nav a 
{
display: block;
}


#nav li ul 
{
position: absolute;
left: 
-999em;
}



#nav li:hover ul, #nav li.sfhover ul 
{
left: auto;
}


#nav li ul li a 
{
background
-color: #303030;
color: #f2f2f2;
font
-size: 12px;
padding: 5px 
0 2px 7px;
border
-top: 1px solid #fff;
font
-weight: bold;
}


#nav ul li a:hover 
{
text
-decoration: none;
background
-color: #415166;
color: #fff;
font
-size: 12px;
font
-weight: bold;
}


/*#nav ul li a.last { border-bottom: none; }*/

#subMenuAbout, #subMenuAbout li a, #subMenuAbout li a:hover 
{width: 130px;}

#subMenuServices, #subMenuServices li a, #subMenuServices li a:hover 
{width: 160px;}

#subMenuPortfolio, #subMenuPortfolio li a, #subMenuPortfolio li a:hover 
{width: 100px;}

#subMenuResources, #subMenuResources li a, #subMenuResources li a:hover 
{width: 120px;}

#subMenuNews, #subMenuNews li a, #subMenuNews li a:hover 
{width: 100px;}


        
</style>
        
<script language="javascript" type="text/javascript">
<!--//-->&lt;![CDATA[//><!--

sfHover 
= function() {
var sfEls 
= document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++{
sfEls[i].onmouseover
=function() {
this.className+=" sfhover";
}

sfEls[i].onmouseout
=function() {
this.className=this.className.replace(new RegExp(" sfhover/b"), "");
}

}

}

if (window.attachEvent) window.attachEvent("onload", sfHover);

//--><!]]&gt;
        </script>
    
</head>
    
<body>
        
<div id="navBar">
            
<ul id="nav">
                
<li>
                    
<a href="/" tabindex="10" title="Return to the Quirk home page"><img src="/images/nav/home.gif" alt="Home" class="imgover" /></a></li>
                
<li id="menuAbout">
                    
<a href="/about" tabindex="1" title="About Quirk"><img src="/images/nav/about.gif" alt="About" class="imgover" /></a>
                    
<ul id="subMenuAbout">
                        
<li>
                            
<a href="/about" title="About Quirk">About Us</a></li>
                        
<li>
                            
<a href

抱歉!评论已关闭.