Search...
expand( )
Expands the element and sets its collapsed
property to false
.
Description
The expand()
function returns a Promise that is resolved when the
element's collapsed
property has been set to false
.
To learn about the behavior of an expanded element,
see the collapsed
property.
Notes:
In Editor X, an element will not become visible by using
expand()
if it has been marked as "Don't Display" for the current breakpoint. Callingexpand()
will however, change thecollapsed
property of the element tofalse
.It is recommended not to mix
expand()
andcollapse()
with "Don't Display" in Editor X.
Syntax
function expand(): Promise<void>
expand Parameters
This function does not take any parameters.
Returns
Fulfilled - When the element's collapsed
property has been set to false
.
Return Type:
Promise<void>
Mixed in from:$w.HiddenCollapsedElement
Was this helpful?
Expand an element
Copy Code
1$w("#myElement").expand();
Expand an element and log a message when done
Copy Code
1$w("#myElement").expand()2 .then( () => {3 console.log("Done with expand");4 } );
Toggle an element's collapsed state
Copy Code
1if( $w("#myElement").collapsed ) {2 $w("#myElement").expand();3}4else {5 $w("#myElement").collapse();6}