JavaScript

A5.buttonselement Method

Syntax

A5.buttons.element(id,settings)

Arguments

idstring

The ID to put on the BUTTON element.

settingsobject

The settings to use to create the button.

themestring

The theme to use on the button.

layoutstring

The layout of the button. A value of "icon text" (the default) or "text icon" which will layout the "icon" and "html" horizontally. A value of "icon" or "text" will only use only "icon" or "text" in the layout. A value of "icon/text" or "text/icon" will layout the "icon" and "html" vertically. A value of "icon-text" or "text-icon" will layout the "icon" and "html" horizontally, but align them to the left and right of the button with any additional width consumed in the center of the button. In all cases the "icon" will be automatically dropped if none is specified.

htmlstring

The HTML to put in the button.

iconstring

The icon to put in the button. See A5.u.icon.

hoverIconstring

The icon to put in the button when the user hovers over it. See A5.u.icon.

pressedIconstring

The icon to put in the button when it is pressed. See A5.u.icon.

disabledIconstring

The icon to put in the button when it is disabled. See A5.u.icon.

tipstring

The TITLE attribute to put in the button that will appear as a tool tip when the user hovers over the button.

stylestring

The CSS to put on the button.

classNamestring

The class name to put on the button.

hoverClassNamestring

The class name to put on the button when the user hovers over it.

pressedClassNamestring

The class name to put on the button when the user presses it.

iconStylestring

The CSS to put on the button icon.

iconClassNamestring

The class name to put on the button icon.

Returns

buttonelement

A BUTTON element.

Description

Create a BUTTTON DOM element.

Discussion

This method will create a BUTTON element based on the passed in settings. The passed in settings are the same as the A5.Button settings. Unlike the A5.Button class, the A5.buttons.element method will not bind events or other javascript logic beyond basic UI interactions such as hover class name changes.

Example

// assume cEle is an element into which the BUTTON wants to be added
var bEle = A5.buttons.element('saveButton',{theme: 'Alpha', html: 'Save'});
bEle.onclick = function(){
	// save code
}
cEle.appendChild(bEle);