zoukankan      html  css  js  c++  java
  • 固定底部导航

    要实现一个固定底部导航菜单。如图

    ==================

    摘要:

    100%  25%。4个div均分。前面三个div右边有边框,采取25%会挤掉下去。添加

    box-sizing: border-box;
     -moz-box-sizing: border-box;
     -webkit-box-sizing: border-box;
    属性。来达到内容边框合一,不被挤掉下去。
    ============
    这次没有使用:last-child来实现最好一个表格的有边框,没有border-right.因为貌似不支持ie8
    使用了li+li{border-left:1px #dedede solid}相邻兄弟元素的 做左侧边框,来实现。
    发散性思维。
    ===============
    PC端使用 hover属性,达到悬浮一级菜单,显示二级菜单。简单明了,纯css实现。
    客户端不支持hover,使用click属性来实现。记得在meta添加 声明minimum-scale=1.0
    =============

    $(document).ready(function() {
    $(".bottommenu li").click(function(e) {
    if ($(this).find(".pop-layer").is(':hidden')) {
    $(".bottommenu li .pop-layer").hide();
    $(this).find(".pop-layer").show();
    } else {
    $(".bottommenu li .pop-layer").hide();
    }
    e.stopPropagation(); // 阻止冒泡
    });

    $(".pop-layer li").click(function(e) {
    $(".pop-layer li").css('background', '#fff');
    $(this).css('background', '#f0f0f0');
    $(this).parent().show();
    e.stopPropagation(); // 阻止冒泡
    });

    $(document).click(function() { // 点击空白消失
    $(".bottommenu li .pop-layer").hide();
    });
    });

    =========================

    使用到了阻止冒泡事件,可以进一步调研学习

    ===========

    http://blog.csdn.net/auphiria/article/details/7703386

    参考这篇实现,底部,右下三角,纯css实现三角形。

    ==================

    BottomMenu-PC端V1.0链接地址:http://files.cnblogs.com/files/leshao/BottomMenu-PC%E7%AB%AFV1.0.rar

    BottomMenu-移动端V1.0链接地址:http://files.cnblogs.com/files/leshao/BottomMenu-%E7%A7%BB%E5%8A%A8%E7%AB%AFV1.0.rar

    =========================

    感谢诸位群友,朋友大牛,使得完美。

  • 相关阅读:
    基本算法2
    基本算法
    读书笔记 《跟老齐学python》
    python杂记 20200207 离线安装 正则
    傻傻分不清之 Cookie、Session、Token、JWT 转载:https://juejin.im/post/5e055d9ef265da33997a42cc
    并发相关 杂记
    原根
    POJ2749 Building roads
    luogu P4735 最大异或和
    SP913 QTREE2
  • 原文地址:https://www.cnblogs.com/leshao/p/4924196.html
Copyright © 2011-2022 走看看