0.7.4 • Published 2 years ago

@oveleon/push-navigation v0.7.4

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

Contao PushNavigation

Install

$ npm install @oveleon/push-navigation
$ yarn add @oveleon/push-navigation
<script src="https://unpkg.com/@oveleon/push-navigation@latest/build/push-navigation.js"></script>
<link href="https://unpkg.com/@oveleon/push-navigation@latest/build/push-navigation.css" rel="stylesheet"></link>

Usage

import PushNavigation from "@oveleon/push-navigation"

// Use default css
// import "./node_modules/@oveleon/push-navigation/build/push-navigation.css"

new PushNavigation({
    // options ...
});

Options

{
    selector: 'nav.main-navigation',        // Navigation selector
    startSelector: 'strong.active',         // Set start position by selector
    mode: 'slide',                          // ToDo: slide, accordion
    toggle: {
        selector: '#toggle',
        cssClassOpen: 'open'                // Class if navigation is open
    },
    levelStructure: {
        container: 'ul',
        item: 'li.submenu',
    },
    handle: {
        append: null,                       // Append handle to a specific element
        element: 'span',
        content: '❯',
        cssClass: ''
    },
    breadcrumb: {
        element: 'li',
        default: 'Navigation',              // Default breadcrumb title
        closeOnFirst: true,                 // Closes the navigation when clicking on the first breadcrumb
        content: '❮ ',
        textSelector: 'a,strong',           // Element from which the text is taken, for the new breadcrumb title
        cssClass: ''
    },
    keepOpenStateOnResize: false,           // Keep open state at resize
    maxWidth: 768,                          // Breakpoint at which the navigation is switched on/off,
    modules: [],                            // Custom HTML [{ append: 'ul.level_1', markup: '<div>Module<div>' }]
    onShow: () => {},
    onHide: () => {},
    onInit: () => {},
    onDestroy: () => {}
}
0.7.4

2 years ago

0.7.2

3 years ago

0.7.1

3 years ago

0.7.3

3 years ago

0.7.0

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago