Learn how to use $. Messager. Show

Source: Internet
Author: User
1. a pop-up box is displayed at the cursor position!
Function showbysite (event) {var element = document. elementfrompoint (event. x, event. y); // get the click object $. messager. showbysite ({Title: 'My title', MSG: 'message. ', showtype: 'show'}, {top: $ (element ). position (). top + $ (element ). height (), // set $. messager. show top is set to left: $ (element) under the clicked object ). position (). left, // set $. messager. show left is set to align with the clicked object bottom: ""});}/*** specifies the position to display $. messager. show * options $. messager. show options * Param = {left, top, right, bottom} */$. extend ($. messager, {showbysite: function (options, Param) {var site = $. extend ({left: "", top: "", right: 0, bottom:-document. body. scrolltop-document.doc umentelement. scrolltop}, Param | |{}); var win =$ ("body> Div. messager-Body "); If (win. length <= 0) $. messager. show (options); win = $ ("body> Div. messager-Body "); win. window ("window" cmd.css ({left: site. left, top: site. top, right: site. right, zindex: $. FN. window. defaults. zindex ++, bottom: site. bottom });}});

2. in the lower right corner of the page, a dialog box is displayed.

$. Messager. show ({Title: "Recommended successfully", MSG: "The news you recommended is: <br/> <span style = \" color: red; \ ">" + newstitle + "</span>", showtype: 'slide', width: 300, height: 150, timeout: 2000 });
Note: If the frame (IFRAME) in the webpage is displayed, the pop-up box will also be in the bottom right corner of IFRAME!


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.