Home > Web Front-end > JS Tutorial > body text

jquery blockUI The solution to the problem that the mask cannot disappear and cannot be submitted_jquery

WBOY
Release: 2016-05-16 18:02:14
Original
1170 people have browsed it
Copy code The 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 mask
$("#cancel").click(function() {
$.unblockUI();
});

Unmasking means that the outer layer dynamically generated by js does not disappear.
There is no problem under FF3.0.4 and Chrome, but it is not normal under IE6 IE7 Ie8.
Open the source code and find the following sentence:
Copy the code The code is as follows:

var lyr1 = ($.browser.msie) ? $('')
: $('');

You can see that under IE, it generates an iframe and loads your own in this iframe dialog box.
So, now just the outer layer does not disappear, you can manually make it disappear.
Copy code The code is as follows:

$.blockUI({ message: $("#dialog ")});
$("#cancel").click(function() {
$.unblockUI();
$(".blockUI").fadeOut("slow");
});

OK, IE6 and IE7 are fine.
After using blockui, the mask layer data cannot be submitted to the background. You can use ajax.
You want to submit it later. After asking for advice, I understand that the mask layer is no longer in the current form, so it cannot be submitted if there is no form after submission
The solution is to place the mask layer part into the form
$('#divlogin').parent().appendTo(jQuery("form:first"));---it is still not completely found and placed The mask layer data outside the form is not very clear.
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template