• 固定底部导航


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

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

    摘要:

    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

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

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

  • 相关阅读:
    Rotation issue in XCode 4.5 and iOS 6.0
    Core Data on iOS 5 Tutorial: How To Work with Relations and Predicates
    How To Synchronize Core Data with a Web Service – Part 2
    Unit Testing in Xcode 4 – use OCUnit and SenTest instead of GHUnit
    Migrate old project to ARC
    Core Data on iOS 5 Tutorial: Getting Started
    How To Draw Graphs with Core Plot, Part 2
    How To Use NSOperations and NSOperationQueues
    How To Save Your App Data With NSCoding and NSFileManager
    What's New in iOS
  • 原文地址:https://www.cnblogs.com/leshao/p/4924196.html
Copyright © 2020-2023  润新知