• navLI鼠标滑上显示下拉导航


    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>li导航</title>
    <style type="text/css">
    *{padding: 0;margin: 0;}
    #box{ 100%;background: red;height: 50px;margin: 0 auto;position: relative;min- 500px;}
    #list{margin: 0 400px;min- 500px;}
    #list li{list-style: none;float: left;padding: 10px;background: paleturquoise;cursor: pointer;
    }
    #hide{ 86px;height: 150px;background: blueviolet;position: absolute;top: 39px;
    left: 451px;display: none;}
    #hide ul li{list-style: none;text-align: center; 67px;height: 38px; line-height: 38px;}
    </style>
    <script type="text/javascript" src="js/jquery.js" ></script>

    </head>
    <body>
    <div id="box">
    <ul id="list">
    <li>首页</li>
    <li id="pro">产品列表


    </li>
    <li>活动介绍</li>
    <li>联系我们</li>

    </ul>
    <div id="hide">
    <ul >
    <li>首页</li>
    <li>表头</li>
    <li>首页</li>
    <li>首页</li>
    </ul>
    </div>
    </div>

    <script type="text/javascript">
    $(function(){
    var pro = document.getElementById("pro");
    var hide = document.getElementById("hide");

    pro.onmouseover = function(ev){
    var ev = ev || event;
    hide.style.display = 'block';
    ev.cancelBubble = 'true';

    }
    hide.onmouseover = function (ev){
    var ev = ev || event;
    ev.cancelBubble = 'true';
    }

    document.onmouseover = function (){
    hide.style.display = 'none';
    }

    })
    </script>
    </body>
    </html>

  • 相关阅读:
    memcached客户端memadmin安装使用
    git之一: 在windows下安装git和使用总结
    nginx常用命令
    mysql授权 REVOKE 添加用户等
    mysql密码忘记解决
    个人常用alias
    解决zabbix图形界面中文乱码
    JsonPath的使用
    Httpclient 支持https(转)
    字符串拼接‘+’实现
  • 原文地址:https://www.cnblogs.com/qiyc/p/5859423.html
Copyright © 2020-2023  润新知