zoukankan      html  css  js  c++  java
  • 仿Chinaz首页菜单导航


    主要技术点在延迟关闭DIV
    效果图:


    源码下载:点击下载

    简洁版代码:

    <!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=utf-8" />
    <title>无标题文档</title>

    <script type="text/javascript" language="javascript">
    function $(id)
    {
        
    return document.getElementById(id);
    }

    function showMenu (baseID, divID) 
    {
        baseID 
    = $(baseID);
        divID  
    = $(divID);
        
    if (showMenu.timer) clearTimeout(showMenu.timer);
        hideCur();
        divID.style.display 
    = 'block';
        showMenu.cur 
    = divID;

        
    if (!divID.isCreate) 
        {
            divID.isCreate 
    = true;
            
    //divID.timer = 0;
            divID.onmouseover = function () 
            {
                
    if (showMenu.timer) clearTimeout(showMenu.timer);
                hideCur();
                divID.style.display 
    = 'block';
            };

            
    function hide () 
            {
                showMenu.timer 
    = setTimeout(function () {divID.style.display = 'none';}, 1000);
            }

            divID.onmouseout 
    = hide;
            baseID.onmouseout 
    = hide;
        }
        
    function hideCur () 
        {
            showMenu.cur 
    && (showMenu.cur.style.display = 'none');
        }
    }
    </script>
    </head>

    <body>
        
    <id="aIndex1" runat="server" href="/cn/ABC.aspx" onmouseover="showMenu('aIndex1','divFloatDIV');">频道名1</a>
        
    <div id="divFloatDIV" style="200px; height:200px; background-color:#999999; display:none;">aaaaaaaaaaaaaaaaaa</div>
    </body>
    </html>
  • 相关阅读:
    cento7快速修改主机名和修改root密码
    [goolegke]nginxingress建立测试
    filebeat安装读取nginx json日志
    MySQL索引背后的数据结构及算法原理
    Lua脚本在redis分布式锁场景的运用
    Sentinel实现限流
    java架构技术流程图
    mybatis数据加解密处理方案
    vue 自定义代码片段
    node项目vue 自动化部署之pm2
  • 原文地址:https://www.cnblogs.com/wangpei/p/1551827.html
Copyright © 2011-2022 走看看