Jump to content
View in the app

A better way to browse. Learn more.

Invision Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ips.ui.flashMsg

Description

The flashMsg widget can be used to display a 'flash message' to the user - a short notification that appears on the screen for a few seconds, before disappearing. It is commonly used for 'success' messages when an action occurs.

 

Example

@todo

 

Usage

A flash message can be created with the data API, as follows:

<span data-ipsFlashMsg data-ipsFlashMsg-text='My message'>

The element used with this method is not important; the widget will not interact with the element in any way.

However, in most cases, flash messages will be created on the fly in response to user actions, so the more common use will be calling them programatically. This can be done in javascript modules with the following code:

ips.ui.flashMsg.show('My message');

Flash messages can be automatically created in two additional ways:

  • Cookies - set a cookie with the key flmsg. The cookie will be deleted after the message displays.
  • URL - pass the parameter flmsg in the page URL, with the value being the message to show. The value should be URL encoded.

 

Options

text
(String; required)

The text to display in the flash message. A sentence or two maximum is recommended.

 

extraClasses
(String; optional; default 'ipsPad')

A space-separated string of extra CSS classnames that will be applied to the flash message box.

 

timeout
(Number; optional; default 2)

The number of seconds for which this flash will be shown before hiding itself.

 

Events

closeFlashMsg.flashMsg

Hides the currently-shown flash message. If any messages are queued, the next will be shown automatically.

Edited by Rikki

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.