Webanizr Logo
Open / sluit menu
Module layeredSlideMenu

The layeredSlideMenu module constructs and controles slide in menu's. It expects the HTML to be constructed in the following way to work properly:

<ul id="mymenu">
    <li>
        <span>1. listim</span>
        <ul>
            <li>
                <span>1.1. listitem</span>
                <ul>
                    ...

syntax (collect)

webanizr.collect('layeredSlideMenu', parameters, callback)

parameters

The layeredSlideMenu module accepts the following parameters:

id__menu (required)

The HTML id of the menu to be constructed.

class__navitems (otpional)

If this parameter is set, the module looks for <div class="..."> (where ... is the value given to class__navitems) instead of <li> for list items.

class__submenu (optional)

If this parameter is set, this module looks for <div class="..."> (where ... is the value given to class__submenu) instead of <ul> for submenu's.

class__activemenu (optional)

The css class that is given to the submenu to make it active. If this parameter is omitted the css class "active" is used.

callback

The callback is called after the menu is constructed. The callback receives no data from this module.

syntax (send)

webanizr.send('layeredSlideMenu', data, parameters, callback)

data

The data is send unaltered to the callback function.

parameters

The layeredSlideMenu module accepts the following parameters:

id__menu (required)

The HTML id of the menu you want to manipulate.

type__action (required)

The type of action you want to perform on the menu. The following options are supported:

  • back: slide out the most recent submenu that slided in

callback

The callback function is called after the action is performed. The data is send unaltered to this callback function.

Webanizr vars

The layeredSlideMenu maintains the following Webanizr variables:

level__<menuid>

Where <menuid> is the HTML id of a menu. The value of this variable is the number of opened menu's. The lowest value is 1, since the main menu is always opened. Every time a submenu is opened, this value increases. Every time the back action is called, the value decreases.

Demo

A demo of a layered slide in menu:

https://cdn.cpmodules.webanizr.com/demo/layer-slide-menu/index.html