(extends Object)
Object Summary
This object models a button which has an on-off (or 1-0) state, which makes it possible to programatically switch it via client-side scripting.
ImageButton can be used to represent two-state events
(like system is working/system is down, valid action/invalid action, stop/go etc).
Constructor
ImageButton(elmID,strOnURL,strOffURL,intCurrentState)
parameters
elmID - The object reference or String index of the DHTML element.
strOnURL - The URL of the on image (when state is 1).
strOffURL - The URL of the off image (when state is 0).
intCurrentState - The initial state of the object.
comments
Methods
comments
returns
true if the state is 1, false otherwise.
comments
Checks whether the button is on.
returns
true if the button not isOn(), false otherwise.
comments
Checks whether the button is off.
returns
The current state of the button, 0 if button is off; 1 otherwise.
comments
Gets the button state.
Use isOn() or isOff() methods instead.
ImageButton.setButtonState(intState)
parameters
intState - The state to set (1 or 0)
comments
Sets the button state.
The method only changes the state, it does not update, the src of the button.
Using this method independently may cause inconsistencies.
returns
The URL of the image according to the state of the button
comments
Gets the URL of the image according to the state of the button.
See Also
ImageRollover
Usage Examples
Comments (0)
You don't have permission to comment on this page.