简体   繁体   中英

Modal Window Second time open Javascript stop

i'm using kendo Ui and jbox, i can open many times kendo ui window it's working perfect. i was integrared jbox modal window on Kendo ui Window. if i open jbox modal window on kendo ui window it's too working perfect. if i don't close kendo ui window i can open many times jbox modal window it's working good. if i reopen kendo window i can open jbox modal but in jbox javascript content doesn't work properly. i thinks it's about Jquery but i can't solve . Jquery 1.9.1 Version

here is my code,

my index;

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 });

});

kendo ui window script's

$('#FavouriteWrp').jBox('Modal', {
  width: 602,
  height: 495,
  closeButton: true,
  ajax: {
    url: '/Account/Login',
    data: '',
    reload: true
   },
   onClose: function () { ResetAllLoginStuff(); }
});

Jbox Modal Window Conent Script,(if i close and reopen kendo window and after if i open jbox modal window this codes not working)

$("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();

can somebody help me, thanks a lot

当我刷新页面时,我看到jQuery versiob发生冲突,因此我使用了最新版本的jquery,问题就消失了。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM