Go to page content

mask

Place a mask over an element.

Places a mask over an element, useful for blocking user interaction during lengthy postbacks.

Example:

<a id="{{ #fb_logon }}" href="#facebook"><img src="/lib/images/fb-login-button.png" width="154" height="22" alt="Facebook login button" /></a>
{% wire id=#fb_logon 
    action={mask target="logon_outer" message="Waiting for Facebook …"} 
    action={redirect dispatch="facebook_authorize"} %}

In this example the logon_outer div will be masked while the browser is being redirected to Facebook.

Form postbacks are automatically masked.

Note that you need to include a css and a js file to have working masks:

{% lib "css/jquery.loadmask.css" %}
{% lib "js/modules/jquery.loadmask.js" %}

This action takes three possible arguments.

ArgumentDescriptionExample
targetThe id of the element to be maskedtarget="search-form"
messageMessage to show next to the spinner image.

message="Searching..."

delayDelay (in milliseconds) before the mask is shown.  Only shows the mask during lengthy actions.delay=200

See also the action unmask.

This page is part of the Zotonic documentation, which is licensed under the Apache License 2.0.