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.