Giter Site home page Giter Site logo

nathobson / greedynav Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lukejacksonn/greedynav

0.0 2.0 0.0 184 KB

A responsive navigation menu that stacks items into a dropdown menu when they overflow

Home Page: http://codepen.io/lukejacksonn/pen/PwmwWV

License: MIT License

HTML 29.19% CSS 47.47% JavaScript 23.35%

greedynav's Introduction

Greedy Navigation

Include the style and script files then put the <nav> code in the <body> of your project. When the user resizes the window the nav will shrink, any overflowing items will be removed from the visible list and get prepended to a list of vertically stacked items that are hidden. The user is notified of this action by a count badge next to a hamburger icon at the end of the menu, which acts as a dropdown trigger button for the hidden list.

##Usage

<head>
<link href="greedynav.css" rel="stylesheet" type="text/css" >
<script src="greedynav.js"></script>
</head>
<body>
  <nav class='greedy-nav'>
  <button><div class="hamburger"></div></button>
    <ul class='visible-links'>
      <li><a href='#'>Greedy</a></li>
      <li><a href='#'>navigation</a></li>
      <li><a href='#'>that</a></li>
      <li><a href='#'>handles</a></li>
      <li><a href='#'>overflowing</a></li>
      <li><a href='#'>menu</a></li>
      <li><a href='#'>elements</a></li>
      <li><a href='#'>effortlessly</a></li>
    </ul>
    <ul class='hidden-links hidden'></ul>
  </nav>
</body>

TODO

  • Cleanup greedynav.less
  • Add debounced resize
  • Make into a web component

greedynav's People

Contributors

atelierbram avatar lukejacksonn avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.