BBjWebManager::toggleClass
Description
In BBj 24.00 and higher, this method toggles a class name on a selected element on the web page.
Note:
In BBj 22.03 and higher, BBjWebManager is an alias for BBjBuiManager.
Syntax
Return Value | Method |
---|---|
boolean | toggleClass(String className) |
boolean | toggleClass(String className, String selector) |
Parameters
Parameter | Description |
---|---|
className | Specifies a CSS class name to be toggled on the control. |
selector | By default, BBjWebManager::toggleClass applies to the document element on the web page. If a selector is specified, it selects a descendant element within the document. If a specified selector doesn't return any elements, the default document element is used. |
Return Value
If the specified className was set on the selected element, this method removes it and returns false (0). If the specified className was not set on the selected element, this method adds it and returns true (1).
Remarks
This corresponds to Element::classList::toggle.
Example
|
Version History
See Also
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.