The first time you open the page in the lower right corner pop-up message __javascript

Source: Internet
Author: User

In the initialization of the page pop-up message box, this and background message push is not the same, just load the page to query some data and then through the form of pop-up box to display: to achieve the purpose of prompting the user attention.

First to download the Jquery.messager.js plug-in, the introduction of JS

<scripttype= "Text/javascript" src= "<%=request.getcontextpath ()%>/javascript/jquery-1.8.2.js" ></ Script>

<scripttype= "Text/javascript" src= "<%=request.getcontextpath ()%>/javascript/jquery.messager.js" > </script>

Here is a simple jquery ajax submission:

$ (function() {

$.messager.lays (200, 150);//define message box size

$.ajax ({

URL: ' Ydxxshblh_ydxxshcount.do ',

Success:function(res) {

var count=$.json (res). Json.count;

$.messager.show ("Prompt Information", ' You have a ' +count+ ' case will expire, please deal with it as soon as possible.) ', 3000);

}

});

});

3000 means that the message box will appear for 3 seconds, and you can define it yourself, note: If this argument is 0, then the message box will not disappear itself, you have to click the fork to close.



You define how the message box pops up

$.messager.anim (' fade ', 1000);//show,slide

This method is to define the form of a message box pop-up, if there is no default is to move up from the bottom up fade is gradually appear, show is slide is sliding, default is slide way, the following is the default initialization:

this. Original = function() {

this. Layer = {

' Width ': 200,

' Height ': 100

};

this. title = ' Informational hint ';

this. Time = 4000;

this. anims = {

' Type ': ' Slide ',

' Speed ': 600

};

};

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.