弘帝企业智能建站系统交流平台

 找回密码
 立即注册
查看: 5059|回复: 3

MENU菜单功能示范脚本

[复制链接]
发表于 2018-1-15 22:01:52 | 显示全部楼层 |阅读模式
重大调整,弘帝框架及弘帝HTML6全面替代原MENU设计思想
新的HTML6代码:
<navbar-toggler class="本功能样式" btn="手机菜单按纽的样式" tar="调用的目录菜单ID" menu="目录菜单的手机样式" show="默认手机的菜单项是否显示"></navbar-toggler>
navbar-toogler暂时用bootstrap命名法,此标签可显示在任意位置。

弘帝启用FLEX技术全面取代老式排版
zgghczy.jpg
DIV:
<div class="menu">$func_menu(pos=0,divi=none)$</div>

CSS:
.menu{ height: 60px; background: #5A342b;text-align: center;}
.menu .MenuCenter{ display:block; width:1200px; margin: 0 auto;}
.menu ul{ display: flex; justify-content: center; flex-direction: row;}
.menu ul li{flex-grow:1;}
.menu ul li a{ display:block; color: #fff; line-height: 60px; font-size: 15px;}
.menu ul li a:hover,.menu ul .sel a{ background:#472922;}

JS:
$(function(){var o=jQuery(".menu ul li .sel");$(function(){$(".menu ul li").hover(function(){o.removeClass();$(this).children("ul").slideDown()},function(){o.addClass("sel");$(this).children("ul").slideUp()})})});
回复

使用道具 举报

 楼主| 发表于 2019-8-17 22:10:35 | 显示全部楼层
固定底部的菜单
fixed-bottom.jpg
DIV:
<div class="fixed-bottom w-100 blue hidden-lg">$func_menu(pos=1,divi=none)$</div>
SCSS:须加载hondy.css
  1. .fixed-bottom {
  2.     .on a:hover {
  3.         color: $white;
  4.     }

  5.     ul li {
  6.         text-align: center;

  7.         &::before {
  8.             margin: 0 auto;
  9.             font-size: 24px;
  10.             justify-content: center;
  11.         }

  12.         &:nth-child(1):before {
  13.             text-align: center;
  14.             content: '\f015';
  15.         }

  16.         &:nth-child(2)::before {
  17.             content: '\f097';
  18.         }

  19.         &:nth-child(3)::before {
  20.             content: '\f07a';
  21.         }

  22.         &:nth-child(4)::before {
  23.             content: '\f098';
  24.         }

  25.         a {
  26.             padding: 0;
  27.             font-size: 12px;
  28.         }
  29.     }
  30. }
复制代码




回复 支持 反对

使用道具 举报

 楼主| 发表于 2019-8-18 15:41:51 | 显示全部楼层
soft.jpg
DIV:
<div class="py-3">
        <div class="container">
                <div class="row">
                        <div class="logo col-lg-3">$show_logo$</div>
                        <div class="red menu col-lg-9 menu-lg-underline">$func_menu(pos=0,divi=none,sub=1)$</div>
                </div>
        </div>
</div>


CSS:
  1. .red {
  2.     background: $red;
  3.     color: $white;

  4.     menu {
  5.         ul {
  6.             li {
  7.                 a {
  8.                     color: $white;
  9.                 }

  10.                 &.on,
  11.                 &:hover {
  12.                     a {
  13.                         background: $orange;
  14.                     }

  15.                     ul {

  16.                         li {
  17.                             a {
  18.                                 &:hover {
  19.                                     color: $white;
  20.                                 }
  21.                             }
  22.                         }
  23.                     }
  24.                 }
  25.             }
  26.         }

  27.     }
  28. }

  29.     .menu-lg-underline {
  30.         background: transparent;
  31.         color: inherit;

  32.         ul {
  33.             li {
  34.                 text-align: center;

  35.                 a {
  36.                     display: inline-flex;
  37.                     color: inherit !important;
  38.                     border-bottom: 2px solid transparent;

  39.                     b {
  40.                         display: none;
  41.                     }
  42.                 }

  43.                 &.on,
  44.                 &:hover {


  45.                     a {
  46.                         background: $white !important;
  47.                         color: inherit;
  48.                         border-bottom: 2px solid $red;
  49.                     }

  50.                     ul {
  51.                         background: $red;

  52.                         li {
  53.                             background: $red;

  54.                             a {
  55.                                 background: $red !important;
  56.                                 display: flex;
  57.                                 white-space: nowrap;
  58.                                 text-align: left;
  59.                                 padding-left: 40px;
  60.                                 padding-right: 40px;
  61.                                 justify-content: left;
  62.                                 border-bottom: 0 !important;
  63.                                 color: $white !important;

  64.                                 &:hover {
  65.                                     background: $gray !important;
  66.                                     color: inherit !important;

  67.                                     &::before {
  68.                                         margin-left:-20px;
  69.                                         content: '\f02e';
  70.                                         margin-right: 10px;
  71.                                         color: $orange;
  72.                                     }
  73.                                 }
  74.                             }
  75.                         }
  76.                     }
  77.                 }

  78.                 ul {
  79.                     background: $red;
  80.                     left: 0;
  81.                     margin-top: -2px;
  82.                     width: auto;

  83.                 }
  84.             }
  85.         }
  86.     }
复制代码

回复 支持 反对

使用道具 举报

 楼主| 发表于 2025-6-3 17:05:41 | 显示全部楼层

LOGO在菜单中心的示范

模板:meiyi | 250603
效果:
微信图片_20250603170745.jpg

HTML:
<div class="container-fluid header">
    <div class="container-xxl">
        <div class="row justify-content-lg-between align-items-center">
            <div class="logo d-xl-none">$show_logo$</div>
            <div class="menu d-none d-xl-flex" id="navbar">$func_menu(pos=0,sub=2,divi=none)$</div>
            <navbar-toggler class="fixed-top text-right mt-3" btn="bg-fst white m-3 mt-4 d-inline-block d-xl-none"
                tar="navbar" menu="bg-fst px-0 red li-hover-sec hover-white ul-li-2" show="false"></navbar-toggler>
        </div>
    </div>
</div>


CSS:
.Logo {
    display: flex;
    flex-flow: column-reverse wrap;
    margin-bottom: 1rem;

    .dt {
        font-size: 2rem;
    }

    .dd {
        img {
            max-width: 100%;
            filter: brightness(100%);
        }
    }
}

li.logo {
    flex-grow: 1;
    flex-shrink: 0;
    flex-basis: auto;

    .Logo {
        img {
            max-height: 60px !important;
            width: auto !important;
            max-width: auto !important;
        }

    }
}

.header {
    background-color: rgba($color: white, $alpha: 0.5);

    .menu {
        display: flex;
        flex-grow: 1;

        ul {
            flex-grow: 1;

            li {
                padding-left: 20px;
                padding-right: 20px;
                position: relative;

                a {
                    padding-top: 10px;
                    padding-bottom: 10px;
                }

                ul {
                    position: absolute;
                    background-color: rgba($color: white, $alpha: 0.5);
                    padding-top: 10px !important;
                    padding-bottom: 0 !important;
                    top: 100% !important;
                    left: 50% !important;
                    transform: translateX(-50%);
                    z-index: 10000;

                    li {
                        padding: 0;

                        a {
                            font-weight: 100 !important;
                            padding: 10px 15px;
                        }

                        ul {
                            display: none !important;
                        }

                        &:last-child {
                            border-bottom: 0;
                        }

                        &:hover {
                            background-color: darken($fst, 5%) !important;

                            a {
                                color: white !important;
                            }

                            ul {
                                display: flex !important;
                                position: absolute;
                                top: 0 !important;
                                left: 150% !important;
                                padding: 0 !important;
                                background-color: $fst;

                                li {
                                    border-bottom: 1px solid rgba($color: white, $alpha: 0.1);

                                    &:hover {
                                        background-color: #2D3D87 !important;
                                    }
                                }
                            }
                        }

                    }
                }

                &:hover {
                    // background-color: $fst;

                    ul li a {
                        // color: white;
                        font-weight: 600;
                    }
                }
            }
        }
    }
}


JS:
$(function(){
    moveLogoToMiddle();
});
//将logo移动主菜单中间
function moveLogoToMiddle() {
    const $menu = $(".header menu");
    const $logo = $(".Logo");
    const $menuItems = $menu.find("ul li.menutop.li3");

    // 先移除 Logo(避免重复插入)
    $logo.detach();

    // 用 <li> 包裹 Logo
    const $logoLi = $("<li class='logo'></li>").append($logo);
    $logoLi.insertAfter($menuItems);
}


回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|芜湖万网信息技术服务中心 弘帝企业智能建站系统 ( 皖ICP备07503252号 )

GMT+8, 2025-6-16 18:17 , Processed in 0.063537 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表