Responsive replacement for Semantic UI's navigation menu

pbarney

Semantic UI has some problems when it comes to it's menu collection. In short, it's not responsive at all, and the closest thing to it is their "stackable" implementation to simply show the menu as a stack.

Can anyone here recommend a good navigation menu that integrates well with semantic ui?

Thanks for any input.

Priyanka Thombre

I have changed my previous code and tried making the semantic UI navigation responsive. This HTML code is based on the semantic UI which I have tried to keep as minimal as possible and added css and JS code for the transition features. I hope this helps.

I have created a fiddle with the new code. below is the link https://jsfiddle.net/1712/g6agpoy9/

<!-- language: lang-css -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.6/components/reset.min.css" rel="stylesheet" />

    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.6/components/site.css" rel="stylesheet" />
    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.6/components/container.min.css" rel="stylesheet" />

    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.6/components/grid.min.css" rel="stylesheet" />

    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.6/components/header.min.css" rel="stylesheet" />

    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.6/components/menu.min.css" rel="stylesheet" />

    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.6/components/dropdown.css" rel="stylesheet" />

    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.6/components/transition.min.css" rel="stylesheet" />



    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.6/components/sidebar.min.css" rel="stylesheet" />

    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.6/components/icon.min.css" rel="stylesheet" />

    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.6/components/segment.min.css" rel="stylesheet" />


    .hidden.menu {
      display: none;
    }
    .masthead.segment {
      min-height: 700px;
      padding: 1em 0em;
    }
    .masthead .logo.item img {
      margin-right: 1em;
    }
    .masthead .ui.menu .ui.button {
      margin-left: 0.5em;
    }
    .masthead h1.ui.header {
      margin-top: 3em;
      margin-bottom: 0em;
      font-size: 4em;
      font-weight: normal;
    }
    .masthead h2 {
      font-size: 1.7em;
      font-weight: normal;
    }
    .ui.vertical.stripe {
      padding: 8em 0em;
    }
    .ui.vertical.stripe h3 {
      font-size: 2em;
    }
    .ui.vertical.stripe .button + h3,
    .ui.vertical.stripe p + h3 {
      margin-top: 3em;
    }
    .ui.vertical.stripe .floated.image {
      clear: both;
    }
    .ui.vertical.stripe p {
      font-size: 1.33em;
    }
    .ui.vertical.stripe .horizontal.divider {
      margin: 3em 0em;
    }
    .quote.stripe.segment {
      padding: 0em;
    }
    .quote.stripe.segment .grid .column {
      padding-top: 5em;
      padding-bottom: 5em;
    }
    .footer.segment {
      padding: 5em 0em;
    }
    .secondary.pointing.menu .toc.item {
      display: none;
    }
    @media only screen and (max-width: 700px) {
      .ui.fixed.menu {
        display: none !important;
      }
      .secondary.pointing.menu .item,
      .secondary.pointing.menu .menu {
        display: none;
      }
      .secondary.pointing.menu .toc.item {
        display: block;
      }
      .masthead.segment {
        min-height: 350px;
      }
      .masthead h1.ui.header {
        font-size: 2em;
        margin-top: 1.5em;
      }
      .masthead h2 {
        margin-top: 0.5em;
        font-size: 1.5em;
      }
    }

<!-- language: lang-html -->



    <!-- Following Menu -->
    <div class="pusher">
      <div class="ui inverted vertical masthead center aligned segment">
        <div class="ui container">
          <div class="ui large secondary inverted pointing menu">
            <a class="toc item">
              <i class="sidebar icon"></i>
            </a>
            <a class="active item">Home</a>
            <a class="item">Work</a>
            <a class="item">Company</a>
            <a class="item">Careers</a>
          </div>
        </div>
      </div>
    </div>
    <!-- Sidebar Menu -->
    <div class="ui vertical inverted sidebar menu">
      <a class="active item">Home</a>
      <a class="item">Work</a>
      <a class="item">Company</a>
      <a class="item">Careers</a>
      <a class="item">Login</a>
      <a class="item">Signup</a>
    </div>


    <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.6/semantic.min.js"></script>

    <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.6/components/sidebar.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.6/components/visibility.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.6/components/transition.js"></script>
<!-- language: lang-js -->

    $(document)
      .ready(function() {

        // create sidebar and attach to menu open
        $('.ui.sidebar')
          .sidebar('attach events', '.toc.item');

      });
<!-- end snippet -->

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Materializecss responsive menu not working?

来自分类Dev

Semantic-UI 的搜索元素返回 TypeError

来自分类Dev

How to make Google Charts responsive with navigation tabs

来自分类Dev

Navigation submenu push a div below down (Responsive)

来自分类Dev

wordpress navigation menu without sub menu

来自分类Dev

React CSS Webpack Hashing & Usage with semantic-ui-sass, semantic-ui-react

来自分类Dev

Process lots of small tasks and keep the UI responsive

来自分类Dev

如何将Semantic-UI添加到Phoenix

来自分类Dev

使用Semantic-UI的最低JQuery版本是什么

来自分类Dev

使用Semantic-UI的div的垂直对齐

来自分类Dev

使用Webpack反应Semantic-ui捆绑包的大小太大

来自分类Dev

Internet Explorer 9中的Semantic-UI 2.0?

来自分类Dev

流星中的Semantic-ui复选框

来自分类Dev

React和Semantic-ui-react,代理事件

来自分类Dev

修复了 react-semantic-ui 中的侧边栏

来自分类Dev

Semantic-ui-react:搜索结果不可见

来自分类Dev

ReactJS Semantic ui - 当值属性存在时无法输入表单

来自分类Dev

Semantic-UI Dropdown 也在“数据值”中搜索

来自分类Dev

如何使用 Semantic-UI 中的占位符元素?

来自分类Dev

HTML Semantics: Should the icon to trigger the menu on a responsive page be included in the nav?

来自分类Dev

sed s / REGEXP / REPLACEMENT / g的执行周期

来自分类Dev

ActiveAdmin navigation_menu似乎根本没有更改菜单

来自分类Dev

ActiveAdmin navigation_menu似乎根本没有更改菜单

来自分类Dev

如何在Laravel 5.2中增加Semantic-UI表的计数

来自分类Dev

如何使用Semantic-UI配置页面以显示正确的字体类型?

来自分类Dev

使用Semantic-UI(或Font Awesome)图标作为OpenLayers3中的标记

来自分类Dev

如何使用Semantic-UI拥有未修改的案例按钮?

来自分类Dev

Semantic-UI:为什么Body的视口大小不相同?

来自分类Dev

Semantic-UI:两个侧边栏冲突,一次仅一个?

Related 相关文章

  1. 1

    Materializecss responsive menu not working?

  2. 2

    Semantic-UI 的搜索元素返回 TypeError

  3. 3

    How to make Google Charts responsive with navigation tabs

  4. 4

    Navigation submenu push a div below down (Responsive)

  5. 5

    wordpress navigation menu without sub menu

  6. 6

    React CSS Webpack Hashing & Usage with semantic-ui-sass, semantic-ui-react

  7. 7

    Process lots of small tasks and keep the UI responsive

  8. 8

    如何将Semantic-UI添加到Phoenix

  9. 9

    使用Semantic-UI的最低JQuery版本是什么

  10. 10

    使用Semantic-UI的div的垂直对齐

  11. 11

    使用Webpack反应Semantic-ui捆绑包的大小太大

  12. 12

    Internet Explorer 9中的Semantic-UI 2.0?

  13. 13

    流星中的Semantic-ui复选框

  14. 14

    React和Semantic-ui-react,代理事件

  15. 15

    修复了 react-semantic-ui 中的侧边栏

  16. 16

    Semantic-ui-react:搜索结果不可见

  17. 17

    ReactJS Semantic ui - 当值属性存在时无法输入表单

  18. 18

    Semantic-UI Dropdown 也在“数据值”中搜索

  19. 19

    如何使用 Semantic-UI 中的占位符元素?

  20. 20

    HTML Semantics: Should the icon to trigger the menu on a responsive page be included in the nav?

  21. 21

    sed s / REGEXP / REPLACEMENT / g的执行周期

  22. 22

    ActiveAdmin navigation_menu似乎根本没有更改菜单

  23. 23

    ActiveAdmin navigation_menu似乎根本没有更改菜单

  24. 24

    如何在Laravel 5.2中增加Semantic-UI表的计数

  25. 25

    如何使用Semantic-UI配置页面以显示正确的字体类型?

  26. 26

    使用Semantic-UI(或Font Awesome)图标作为OpenLayers3中的标记

  27. 27

    如何使用Semantic-UI拥有未修改的案例按钮?

  28. 28

    Semantic-UI:为什么Body的视口大小不相同?

  29. 29

    Semantic-UI:两个侧边栏冲突,一次仅一个?

热门标签

归档