固定底部导航

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

 

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

摘要:

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

 

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

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

 

转载于:https://www.cnblogs.com/leshao/p/4924196.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值