There are no tracking or monitoring cookies on this site. There are only cookies used for documentation examples related to cookies.
Close

Processing...
This may take a few seconds.

fade-out

Syntax

fade-out: [selector] (duration) [no-hide|complete-then-hide] [await] [every (time)] [after (time)][, (selector)...];

This command fades out an element or a set of elements from an existing opacity. It is more performant to use CSS directly (search for "CSS fade transition") for transitions, but this can be a quick and performant option when there is not a lot else going on on the page.

selector = A optional CSS selector referencing a single element (it supports me, self or this to reference the target selector it is used under) or a set of elements. If this is not specified, fading will occur on the target selector.

duration = The length of time it takes for the fade out to complete. Syntax is regular CSS duration format, eg. 1s (1 second) or 500ms (500 milliseconds).

no-hide = Optional. Using this option will not set the display property to "none" at the end of the fade out.

complete-then-hide = Optional. Using this option will make every element in the selector set wait until all elements having completed the duration before display "none" is set. If any elements already have an opacity of 0, yet are still "displayed", these "hidden" elements will wait until the duration is complete and then have display set to "none", at the same time as the others.

 

This command also supports the await option, which will pause the event flow until the fading has completed before continuing. Note that if the fade does not fully complete, then the event flow will not continue from where it left off. See the fade-to command for an example of using "await".

fade-out