Skip to main content
Version: 11.2

$.udb.opacity()

note

This article is about the opacity() function of the udb object.

$.udb.opacity()

Displays a Opacity Control affecting the user's entire screen. This prevents the user from performing any additional actions while an operation is running.

note

The $.udb.dialog() and $.udb.input() functions have a useOpacity option that automatically adds a modal backdrop layer to prevent users from manipulating the page controls displayed behind their dialog. This is not an Opacity Control, which can adds an extra layer on top of all controls as well.

Returns a UdbPromise object.

Syntax

$.udb.opacity( *display*, [opacity-percentage] )
.then(() => {
// ...
})
;

*display* := { [true] | false }
*opacity-percentage* := Integer[0]

Display is a mandatory boolean that is used to turn the Opacity Control on or off.

  • If display is true, the Opacity Control is displayed. No control behind it can be manipulated then.
  • If display is false, the Opacity Control is removed.

Opacity-percentage is an integer value that can be used to manipulate the transparency of the Opacity Control being displayed. The default is 0 which means the control is fully transparent. A value of 100 or higher makes the control completely opaque, which means that no control displayed behind the Opacity Control is visible.

Examples

$.udb.opacity( true );
$.udb.opacity( true, 20 );