| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

ImageButton

Page history last edited by PBworks 18 years ago


 

ImageButton

(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

Creates a new ImageButton instance.


Methods

 

ImageButton.destruct()

 

comments

Detaches events from the ImageButton


ImageButton.isOn()

 

returns

true if the state is 1, false otherwise.

 

comments

Checks whether the button is on.


ImageButton.isOff()

 

returns

true if the button not isOn(), false otherwise.

 

comments

Checks whether the button is off.


ImageButton.getButtonState()

 

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.


ImageButton.getURL()

 

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.