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>
  • 相关阅读:
    cocos2dx动画常见特效(转)
    cocos2dx常见Action(转)
    cocos2dx常见场景切换动画(转)
    android AlertDialog.Builder(Context context)换行
    使用NPOI操作Excel文件及其日期处理
    java jar文件打包成exe(Launch4j使用说明)
    知识日志2
    知识日记1
    框架体系对小软件作坊的 重要性 第二章
    框架体系对小软件作坊的 重要性 第一章
  • 原文地址:https://www.cnblogs.com/wangpei/p/1551827.html
Copyright © 2011-2022 走看看