Home > Web Front-end > JS Tutorial > The message plug-in based on jQuery realizes the pop-up message box in the lower right corner_jquery

The message plug-in based on jQuery realizes the pop-up message box in the lower right corner_jquery

WBOY
Release: 2016-05-16 18:12:25
Original
1270 people have browsed 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 way and speed at which the window is presented.

$.messager.anim("fade",1000); //Display in animation of fadeIn

$.messager.anim("show",1000); //Display in show animation

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

This method mainly defines the content displayed in the window and how long the window is displayed before hiding.

If you use the default title, set the title to 0. In addition, the title and text can also be set to html content for display. If you want the user to click the close button of the pop-up window to close the message box, you can set time to 0.

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

$.messager.show("Prompt message","",3000);

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

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

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

Copy code The code is as follows:

$(function () {
$.messager .lays(200, 200);
$.messager.anim('fade', 1000);
$.messager.show("prompt message", "Script Home",5000);
});

3. The final displayed effect is as shown below.
The message plug-in based on jQuery realizes the pop-up message box in the lower right corner_jquery
Online demo addresshttp://demo.jb51.net/js/jquery.messager/index.html
Plug-in download: jquery.message.js package download Addresshttp://www.jb51.net/jiaoben/22351.html

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template