AppFrameWork Learning--mask Toast

Source: Internet
Author: User

Mask use is very simple, the official website has introduced:

Incoming text and dwell time are displayed:

function Showmask (text,time) {    $.ui.showmask (text);    Window.settimeout (function () {        $.ui.hidemask ();    }, time);} </span>


Because the official website does not provide toast function, studied, add a few lines of code can:



#afui_mask {position:absolute;top:45%;z-index:999999;} for several files above;} Add the following
 

#afui_toast {position:absolute;top:88%;z-index:999999;}


This JS file

Hidemask:function () {     $.query ("#afui_mask"). Hide ();},</span>


The following functions are added below this function:

/**         * Show the toast *         */        showtoast:function (text) {            $.query ("#afui_toast >h1"). html (text);            $.query ("#afui_toast"). Show ();        },        /**         * Hide the toast */        hidetoast:function () {            $.query ( "#afui_toast"). Hide ();        },


(Don't forget {back, otherwise not available)

Setup Ajax mask            this.addcontentdiv ("Afui_ajax", "" ");            var maskdiv = $.create ("div", {                ID: "Afui_mask",                className: "Ui-loader",                HTML: "<span class=" Ui-icon Ui-icon-loading spin ' ></span>


This JS is added below:

            Toast            var toastdiv = $.create ("div", {                ID: "Afui_toast",                className: "Ui-loader",                HTML: "</span >

So you can use toast like mask, here's the following:

function Showtoast (text,time) {    $.ui.showtoast (text);    Window.settimeout (function () {        $.ui.hidetoast ();    }, time);}



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.