Message Box _ jQuery is displayed in the lower right corner of the message plug-in based on jquery.

Source: Internet
Author: User
Sometimes, when loading a page, you need to bring up a small prompt box in the lower right corner of the page to display some prompt information to the user. By using the jQuery message plug-in, you can easily achieve this effect, before using the message plug-in, let's first introduce how to use it. 1. $. messager. lays (width, height );

This method is mainly used to define the width and height of the pop-up window.

2. $. messager. anim (type, speed );

This method mainly defines the mode and speed at which the window is displayed.

$. Messager. anim ("fade", 1000); // displays it in an animated manner of fadeIn.

$. Messager. anim ("show", 1000); // animated display by show

3. $. messager. show (title, text, time );

This method mainly defines the content displayed in the window and how long the window will be hidden.

If the default title is used, the title is set to 0, and the title and text can be set to html for display. If you want to click the close button in the pop-up window to close the message box, you can set time to 0.

$. Messager. show (0, "This is a prompt", 5000 );

$. Messager. show ("message", "Welcome to blog", 3000 );

After understanding the functions of each method in the message plug-in, it is easy to use. The specific operations are as follows:

1. Introduce the jquery. js and jquery. messager. js files on the page.

2. When loading the page, call the function in the message plug-in to set the window size, display effect, and display content.

The Code is as follows:


$ (Function (){
$. Messager. lays (200,200 );
$. Messager. anim ('fade, 1000 );
$. Messager. show ("prompt message", "script home", 5000 );
});


3. The final result is shown in.

Online Demo address http://demo.jb51.net/js/jquery.messager/index.html
Jquery. message. js package http://www.jb51.net/jiaoben/22351.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.