莫代尔窗口第二次打开Javascript停止
问题描述:
我使用kendo UI和jbox,我可以打开很多次kendo UI窗口它的工作完美。我在Kendo ui Window上整合了jbox模式窗口。如果我在kendo ui窗口上打开jbox模式窗口,它工作得太完美了。如果我不关闭kendo ui窗口,我可以打开很多次jbox模式窗口它工作良好。如果我重新打开剑道窗口,我可以打开jbox模式,但在jbox的JavaScript内容无法正常工作。我认为这是关于JQuery,但我无法解决。 jQuery的1.9.1版本莫代尔窗口第二次打开Javascript停止
这里是我的代码,
我的索引;
var ICCANPopUp;
$(document).on("click", ".k-overlay", function() {
ICCANPopUp.close();
});
$("#LoadFormDiv").kendoWindow({
width: "750px",
height: "90%",
draggable: false,
resizable: false,
modal: true,
title: "",
visible: false,
open: function(e) {
this.wrapper.css({ top: 25 });
$("html, body").css("overflow", "hidden");
},
close: function (e) {
$("html, body").css("overflow", "");
}
});
$('#LoadFormDiv').closest(".k-window").css({
position: 'fixed',
margin: 'auto',
top: '20%'
});
var ICCANPOPUPLOCATIONBEFOREOPEN;
function ICCANPopUpShow() {
ICCANPopUp = $("#LoadFormDiv").data("kendoWindow");
ICCANPopUp.content('<div style="margin-left:40%; margin-top:20%; ">Yükleniyor...<br/><img src="/Content/images/iccan-loader.gif" width="54" height="55" alt="iMarket Ürün Yükleniyor..." /></div>');
ICCANPopUp.title("");
ICCANPopUp.refresh({
url: "/IccanApi/GetProductByID",
data: { ID: 3012 }
});
ICCANPOPUPLOCATIONBEFOREOPEN = $(window).scrollTop();
window.scrollTo(0,0);
ICCANPopUp.center().open();
}
$("#LoadFormDiv").data("kendoWindow")
.bind("close", function (e) {
$("html, body").animate({ scrollTop: ICCANPOPUPLOCATIONBEFOREOPEN });
});
剑道UI窗口脚本的
$('#FavouriteWrp').jBox('Modal', {
width: 602,
height: 495,
closeButton: true,
ajax: {
url: '/Account/Login',
data: '',
reload: true
},
onClose: function() { ResetAllLoginStuff(); }
});
Jbox模态窗口Conent脚本,(如果我关闭并重新打开剑道窗口,如果我打开jbox模态窗口后,该代码不工作)
$("form").submit(function (e) {
$(".ICCAN-Register-processing").css({ "display": "block" });
var emailForRegister = $("#UserName").val();
var passwordForRegister = $("#Password").val();
var passwordValidateForRegister = $("#PasswordValidate").val();
var smsForRegister = $('#Sms').prop('checked');
var mailingForRegister = $('#Mailing').prop('checked');
var agreementForRegister = $('#agreement').prop('checked');
$.ajax({
url: '/Account/Register',
data: JSON.stringify({
UserName: emailForRegister,
Password: passwordForRegister,
PasswordValidate: passwordValidateForRegister,
Sms: smsForRegister,
Mailing: mailingForRegister,
agreement: agreementForRegister
}),
type: 'POST',
contentType: 'application/json; charset=utf-8',
success: function (response) {
if (response.isSuccess) {
alert("Kayıt Başarılı");
$(".ICCAN-Register-processing").css({ "display": "none" });
window.location.replace("/");
}
if (!response.isSuccess) {
$(".ICCAN-Register-processing").css({ "display": "none" });
$("#UserName").css({ "border": "1px solid red" });
$("#ResultText").show();
}
}
});
e.preventDefault();
e.unbind();
});
$("#ResultText").hide();
有人可以帮助我,非常感谢
答
当我刷新页面,我看到了冲突jquery versi ob,所以我使用最新版本的jquery,问题消失了。
在控制台中是否有任何错误?当你重新打开kendo窗口时,什么代码不再工作了? – 2014-10-28 10:21:04