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.
$(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.
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