Dynamic Flash Messages Sample Code

程序名称:Dynamic Flash Messages Sample Code

授权协议: 未知

操作系统: 未知

开发语言:

Dynamic Flash Messages Sample Code 介绍

Overview

Flash messages are messages displayed in response to user interaction with a
site. Typically these are displayed as success or failure messages after
performing an action which submits a form, or in response to an attempt to
access a resource for which the user does not have permission.

Flash messages are useful and provided with several systems automatically;
TurboGears, for instance, provides a tg_flash variable to all templates and
exposes a flash method which can be used to display a message on the next
page load.

This is a simple script which gives this functionality to jQuery, so you can
display flash messages in response to dynamic events such as AJAX calls.

Usage

Usage is simple. Place a div somewhere, usually where you want the flash
message to appear, with an ID of flash. After including jQuery and the
jQuery flash plugin, you can issue a variety of messages using the methods of
the jQuery.flash object.

Default behavior is to fade the message in, wait 15 seconds, then fade the
message out. If the message is an error of any kind, the message will persist.
If the mouse is within the flash message container the message will persist
until the cursor is removed. Clicking on the message will also remove it, even
if it’s an error. Issuing a flash message while one is already displayed will
remove the existing message first.

Default message types include: subtle, error, failure (fail), warning (warn),
information (info), and success. All of these take two arguments: the label
and message. You can issue messages with custom classes by using the message
method, passing three arguments: the class, label, and message.

Sample Code

`<?xml version=”1.0” encoding=”UTF-8”?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN”
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”>
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">


Sample Code





`

Dynamic Flash Messages Sample Code 官网

http://plugins.jquery.com/project/flash

相关编程语言

多功能下拉选择插件 SelectPage 简洁而强大的下拉分...
AutoComplete 是一个 jQuery Mobile 的插件,用于实...
Combogrid 是一个jQuery插件用于为输入框添加高级自...
Autobox2这个jQuery插件,可以用于创建类似于Facebo...
Link Scraper TextBox 是一个文本框的扩展插件,当你...
Awesomplete 超小超好用的超漂亮的 autocomplete 框...