两个横向菜单栏示例
来源:广州中睿信息技术有限公司官网
发布时间:2012/10/21 23:25:16 编辑:admin 阅读 255
//菜单栏示例一:菜单源代码<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml

 

菜单栏示例一:
菜单源代码
<!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>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    <script type="text/javascript">
        $(
function() {
            $(
"#container .menu1 ul li").click(function() {
                
var index = $("#container .menu1 ul li").index(this);
                $(
this).addClass("bg").siblings().removeClass();
                $(
"#container .menu2 ul li ul").eq(index).show().parent().siblings("li").children("ul").hide();
            })
        })
    
</script>

    <style type="text/css">
        body
        
{
            margin
: 0;
            padding
: 0;
            font-family
: "宋体";
            font-size
: 9pt;
            color
: #FFFFFF;
            font-weight
: bold;
        
}
        #container
        
{
            width
: 100%;  /* 1200px; */
            height
: auto;
            margin
: 0 auto;
            
/* border: 1px #1025c0 solid; */

            
/* xugang  2011.10.19 */
            
/* margin: 0; */
            padding
: 0px;
            font-family
: "宋体";
            font-size
: 9pt;
            color
: #FFFFFF;
            font-weight
: bold;
        
}
        #container .menu1
        
{
            width
: 684px;
            height
: 34px;
            border
: none;
            background
: url(sadasd_09.png) no-repeat;
            
/*background: url(http://www.webdm.cn/images/20101213/2/menu1.gif) no-repeat;
            background-color: #1B5582;
*/
        
}
        #container .menu1 ul
        
{
            margin
: 0;
            
/* padding: 0; */
            padding-left
: 0px;
            padding-right
: 0px;
            padding-bottom
: 0px;
            padding-top
: 4px; 
            position
: relative;
            
            margin-left
: 4px;  /* xugang 一级菜 单选择项样式 */
        
}
        #container .menu1 ul li
        
{ /*border: 1px #1025c0 solid;  测试 */
            float
: left;   
            height
: 25px;
            width
: 110px;
            line-height
: 25px;
            list-style
: none;
            text-align
: center;
            cursor
: pointer;
            
/* color: #fffff; */
            padding-left
: 2px;  /* xugang 一级菜单选择项 */
            
/* margin-left: 1px;    xugang 一级菜单选择项  容易使一级菜单动态向右移动 */
        
}
        #container .menu2
        
{
            width
: 100%;  /* 1000px; */
            height
: 25px;
            border
: none;
            color
: #000000;
            font-weight
: normal;
            background-color
: #C9DEFA;   /* #DFF0FF 子菜单颜色 */
            padding-left
: 0px;  /* xugang */
            padding-top
: 0px;  /* xugang */
            margin-left
: 0px;  /* xugang */
        
}
        #container .menu2 ul
        
{
            margin
: 0;  /* xugang 原始  margin: 0; */
            padding
: 0;
        
}
        #container .menu2 ul li
        
{
            height
: 30px;
            line-height
: 30px;
            list-style
: none;
            float
: left;
            cursor
: pointer;
联系我们CONTACT 扫一扫
愿景:成为最专业的软件研发服务领航者
中睿信息技术有限公司 广州•深圳 Tel:020-38931912 务实 Pragmatic
广州:广州市天河区翰景路1号金星大厦18层中睿信息 Fax:020-38931912 专业 Professional
深圳:深圳市福田区车公庙有色金属大厦509~510 Tel:0755-25855012 诚信 Integrity
所有权声明:PMI, PMP, Project Management Professional, PMI-ACP, PMI-PBA和PMBOK是项目管理协会(Project Management Institute, Inc.)的注册标志。
版权所有:广州中睿信息技术有限公司 粤ICP备13082838号-2