• Topic
  • Discussion
  • OATWikiWeb.OATDOCcombobutton(Last) -- Owiki? , 2016-08-19 14:58:50 Edit owiki 2016-08-19 14:58:50

    combobutton.js

    Creates a combobutton, which is a multi-functional button. It enables user to specify a callback action to be performed when it is clicked.

    Objects

    OAT.Combobutton()

    Creates a combobutton. Its main div is accessible as OAT.Combobutton::div.

    Methods

    OAT.Combobutton::addOption(imagePath, textValue, callback)

    Adds a new option, described as textValue with image located at imagePath. When this option is clicked, callback is called.

    OAT.Combobutton::removeOption(index)

    Removes index-th option.

    CSS classes

    .combo_button

    CSS class of the button options list.

    .combo_image

    CSS class of the dropdown clicker image.

    .combo_button_option

    CSS class of the button option div.

    .combo_button_text

    CSS class of the div with textual description of the option.

    .combo_button_down

    CSS class that is added/removed to option whenever the button is clicked/released.

    Example

    var cb = new OAT.Combobutton();
    document.body.appendChild( cb.div );
    cb.addOption("img1.gif", "option 1", function(){});
    cb.addOption("img2.gif", "option 2", function(){});
    cb.removeOption(0);
    

    Referenced by...