Skip to content

Implementation of an accordion menu for Titanium apps

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE.txt
Notifications You must be signed in to change notification settings

codemaker1999/titanium-accordion-menu

Repository files navigation

Titanium Accordion Menu

Implementation of an accordion menu for Titanium apps. Currently only tested on Android. This repo is a demo app, the only file you need to paste into your project is "app/lib/accordion.js".

Usage

  1. Create a container view for the menu items, and set the attribute "accordion" to "true":

    <View id="myView" accordion="true"> ... </View>

    OR...

    var view = Titanium.UI.createView( {accordion: "true", id: "myView"} );
  2. Add elements to the container. The first child element will be assigned the click event handler, and the rest of the children will be hidden when the accordion is collapsed.

  3. Import the module:

    var accordion = require("accordion");
  4. Initialize your view

    $.window.open();
  5. Run the module:

    var depth          = -1;      // no max tree search depth
    var startCollapsed = true;    // initial accordion state is collapsed
    var root           = $.window // this can be element that is a parent of the $.myView
    function callback (containerView) {}; // called when an accordion menu is toggled
    accordion.setup(root, depth, startCollapsed, callback);

About

Implementation of an accordion menu for Titanium apps

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE.txt

Stars

Watchers

Forks

Releases

No releases published

Packages