1.0.9 • Published 7 years ago

edc-nav v1.0.9

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

edc-nav

A plugin javascript for create nav lists responsive

Installation

Using npm:

$ npm i --save edc-nav

Using yarn:

$yarn add edc-nav

Using

The plugin need the next HTML structure

<html>
<head>
  <style>
    .container {
      overflow: hidden;
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="edc-nav header">
      <ul id="demo" class="burger edc-nav edc-nav-btn">
        <li></li><li></li><li></li>
      </ul>
      <h1>edc-nav</h1>
    </div>
    <div class="edc-nav nav">
      <ul>
        <li><a href="#" class="active">link 0</a></li>
        <li><a href="#">link 1</a></li>
        <li><a href="#">link n</a></li>
      </ul>
    </div>
    <div class="edc-nav content">
        Your content goes here...
    </div>
  </div>
</body>
</html>

Include edc-nav.css and edc-nav.js

...
<head>
  ...
  <link rel="stylesheet" href="/{path}/edc-nav/edc-nav.css">
</head>
<body>
  ...
  <script type="application/javascript" src="/{path}/edc-nav/edc-nav.js"></script>
</body>
...

Launch edc-nav when the document is ready

...
<body>
  ...
  <script>
    window.onload = function () {
      edcNav.init();
    };
  </script>
</body>
...

Settings

You can use your custom selectors

...
<body>
  ...
  <script>
    window.onload = function () {
      edcNav.init({
        selector: '.my-awesome-selector',
        trigger_selector: '#my-awesome-button'
      });
    };
  </script>
</body>
...

You can change this properties:

OptionDefaultDescription
selector'.edc-nav'the nav element
trigger_selector'.edc-nav-btn'the btn element, this launch nav
content_selector'.edc-nav.content'the content element
open_class'edc-nav-open'class name used when the nav is showing
close_class'edc-nav-close'class name used when the nad is hidden

License

MIT

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago