Cl.Autocomplete

This is a list of all relevant options, methods, events and callbacks.

Options

Options are set on initializing autocomplete:

new Cl.Autocomplete({
    // your options
    'minLength': 1,
    'fx': 'toggle'
});
Option Default Description
url false sd
minLength 3 sd
easing ‘swing’ the jquery easing method for all animations.
duration 300 the jquery duration speed for all animations.
delay 300 the jquery duration speed for all animations.
fx ‘slide’ the jquery duration speed for all animations.
cls object the available css class getters and setters.
lang object the available language strings.

Option cls setters and getters:

Methods

Methods can be called using an instance of the class:

var mobilemenu = new Cl.Mobilemenu();
    // trigger the method
    mobilemenu.toggle();

All Methods have appropriate events and callbacks.

mobilemenu.toggle(index)
Description:

toggles a specified mobilemenu entry.

Arguments:
  • index (number) – required the index of the element to be toggled.
Returns:

toggle callback.

mobilemenu.show([index])
Description:

opens an mobilemenu entry.

Arguments:
  • index (number) – optional index of the element to be shown, if empty shows all.
Returns:

open callback.

mobilemenu.hide([index])
Description:

hides an mobilemenu entry.

Arguments:
  • index (number) – optional index of the element to be shown, if empty hides all.
Returns:

close callback.

Callbacks

Callbacks are always triggered after the method is excecuted. You can interact with callbacks as follows:

var mobilemenu = new Cl.Mobilemenu();
// register callback
mobilemenu.callbacks.toggle = function () {
    console.log('item has toggled');
};

Available keywords:

toggle
is called when triggering method ``toggle``.
open
is called when triggering method ``open``.
close
is called when triggering method ``close``.