Web Notifications (Toastr)
(part of package 'Web Notifications')
You can access it in code via: plugins.webnotificationsToastr
Properties
API
clear()
Removes current toasts using animation
clearToastr(toastrId)
Removes the toast with the given ID
Parameters:
{Object} toastrId The unique identifier of the toast notification to be removed.
createToastrOptions()
Returns new, empty toastrOptions
Returns: CustomType<webnotificationsToastr.toastrOptions> A new, empty toastrOptions object for configuring toast notifications.
error(message,title,options,toastrId,onClick)
Shows an error toastr with the given message, optional title and options
Example:
Parameters:
{String} message The message to show
{String} [title] The optional title shown above the message
{CustomType<webnotificationsToastr.toastrOptions>} [options] The toastrOptions object with additional options
{Object} [toastrId] The optional id that can be used to clear this specific toastr via clearToastr
info(message,title,options,toastrId,onClick)
Shows an info toastr with the given message, optional title and options
Example:
Parameters:
{String} message The message to show
{String} [title] The optional title shown above the message
{CustomType<webnotificationsToastr.toastrOptions>} [options] ToastrOptions object with additional options
{Object} [toastrId] Optional id that can be used to clear this specific toastr via clearToastr
setGlobalOptions(options)
Sets the given options globally
Parameters:
{CustomType<webnotificationsToastr.toastrOptions>} options ToastrOptions
success(message,title,options,toastrId,onClick)
Shows a success toastr with the given message, optional title and options
Example:
Parameters:
{String} message The message to show
{String} [title] The optional title shown above the message
{CustomType<webnotificationsToastr.toastrOptions>} [options] ToastrOptions object with additional options
{Object} [toastrId] The optional id that can be used to clear this specific toastr via clearToastr
warning(message,title,options,toastrId,onClick)
Shows a warning toastr with the given message, optional title and options
Example:
Parameters:
{String} message The message to show
{String} [title] The optional title shown above the message
{CustomType<webnotificationsToastr.toastrOptions>} [options] The toastrOptions object with additional options
{Object} [toastrId] The optional id that can be used to clear this specific toastr via clearToastr
Types
toastrOptions
Options to configure the appearance and behavior of toastr notifications. scripting type: CustomType<webnotificationsToastr.toastrOptions>
actionButton
If true will show a custom toastr with an additional action
Type: boolean
Default Value: "false"
actionButtonText
When the actionButton is true, set the text to show for the action section; can be an html string
Type: string
closeButton
If true, a close button is displayed on the toast.
Type: boolean
closeHtml
The HTML for the close button.
Type: string
disableTimeOut
If true, disables the auto-hide timeout.
Type: boolean
enableHtml
If true, allows HTML content in the toast message.
Type: boolean
extendedTimeOut
The time in milliseconds for extended timeout on hover.
Type: int
hideDuration
The duration in milliseconds for the hide animation.
Type: int
hideEasing
The easing function to use when hiding the toast.
Type: string
hideMethod
The method used to hide the toast (deprecated for old jQuery implementations).
Type: string
messageClass
CSS class applied to the toast message.
Type: string
newestOnTop
If true, newer toasts appear on top of older ones.
Type: boolean
onActivateTick
If true, activates a tick animation when the toast is activated.
Type: boolean
positionClass
CSS class that determines the position of the toast notification.
Type: string
progressAnimation
The type of animation used for the progress bar.
Type: string
progressBar
If true, displays a progress bar within the toast.
Type: boolean
showDuration
The duration in milliseconds for the show animation.
Type: int
showEasing
The easing function to use when showing the toast.
Type: string
showMethod
The method used to show the toast (deprecated for old jQuery implementations).
Type: string
tapToDismiss
If true, clicking on the toast will dismiss it.
Type: boolean
timeOut
The time in milliseconds before the toast auto-hides.
Type: int
titleClass
CSS class applied to the toast title.
Type: string
toastClass
CSS class applied to the toast container.
Type: string
Last updated
Was this helpful?