The jquery blockUI mask cannot disappear or cannot be submitted

Source: Internet
Author: User

Copy codeThe Code is as follows:
// Display mask
$. BlockUI ({
Message: $ ('# divlogin '),
Css: {width: "400px", height: "255px", top: ($ (window ). height ()-400)/2 + 'px ', left: ($ (window ). width ()-400)/2 + 'px '}
});
// Cancel the mask
$ ("# Cancel"). click (function (){
$. UnblockUI ();
});

The unmask is, And the js dynamically generated outer layer does not disappear.
In FF3.0.4 and Chrome, there is no problem, but IE6 IE7 Ie8 is not normal.
Open the source code and find the following sentence:
Copy codeThe Code is as follows:
Var lyr1 = ($. browser. msie )? $ ('<Iframe class = "blockUI" style = "z-index:' + z ++ '; border: none; margin: 0; padding: 0; position: absolute; width: 100%; height: 100%; top: 0; left: 0 "src =" javascript: false; "> </iframe> ')
: $ ('<Div class = "blockUI" style = "display: none"> </div> ');

As you can see, in IE, it generates an iframe and loads your own dialog box in this iframe.
Now, the outer layer does not disappear. Manually let it disappear.
Copy codeThe Code is as follows:
$. BlockUI ({message: $ ("# dialog ")});
$ ("# Cancel"). click (function (){
$. UnblockUI ();
$ (". BlockUI"). fadeOut ("slow ");
});

OK, IE6 IE7 is okay.
After blockui is used, data in the mask layer cannot be submitted to the background. You can use ajax
Submit it to later. After consultation, I understand that the mask layer is no longer in the current form, so no form cannot be submitted after submission.
Solution: place the mask layer in form.
$ ('# Divlogin '). parent (). appendTo (jQuery ("form: first"); --- it is not clear to find the data in the mask layer that is placed outside the form.

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.