正如标题所说,如果不在屏幕上,弹出框将无法正确显示。这似乎是有道理的,但弹出框的箭头仍然出现。我需要弹出框在页面上可见,即使它不在屏幕上。
我正在使用弹出框作为表单上的验证通知。我正在使用插件 jquery validate。
这是发生的事情的图像。
这是验证的代码:
$(document).ready(function () {
$("#form1").validate({
onsubmit: false,
rules: {
ctl00$MainContent$txtEventName: { required: true },
ctl00$MainContent$txtEventDate: { required: true, date: true },
ctl00$MainContent$txtEventGuests: { required: true, number: true },
ctl00$MainContent$txtZip: { required: true, number: true, minlength: 5 },
ctl00$MainContent$txtEmail: { required: true, email: true },
ctl00$MainContent$txtPwd: { required: true },
ctl00$MainContent$txtConfirmPwd: { equalTo: "#MainContent_txtPwd" }
},
messages: {
ctl00$MainContent$txtEventName: "Please enter the event name",
ctl00$MainContent$txtEventDate: "Please enter a date that is not before today",
ctl00$MainContent$txtEventGuests: "Please enter the amount of guests attending the event",
ctl00$MainContent$txtZip: "Please enter a valid zipcode",
ctl00$MainContent$txtEmail: "Please enter a valid email address",
ctl00$MainContent$txtConfirmPwd: "Your passwords must match"
},
showErrors: function (errorMap, errorList) {
//$.each(this.successList, function(index, value) {
// return $(value).popover("hide");
//});
return $.each(errorList, function(index, value) {
var _popover;
_popover = $(value.element).popover({
placement: "right",
content: value.message,
template: "<div class=\"popover\" style='width: 195px;'><div class=\"arrow\"></div><div class=\"popover-inner\"><div class=\"popover-content\"></div></div></div>"
});
return $(value.element).popover("show");
});
},
submitHandler: function (form) { // for demo
return false; // for debug
}
});
});
有人对我能做些什么来解决这个问题有任何想法吗?