简体   繁体   English

Bootstrap Modal 在 Chrome 中不起作用

[英]Bootstrap Modal not working in Chrome

All,全部,

I'm having an issue with bootstrap 3 modal not working properly in Chrome or Edge.我遇到了引导程序 3 模式在 Chrome 或 Edge 中无法正常工作的问题。 The modal works fine in FireFox.模态在 FireFox 中工作正常。 Note!笔记! The modal does eventually display for a split second before the second modal "message" is displayed (which works fine in all browsers).在显示第二个模态“消息”之前,模态最终会显示一秒钟(在所有浏览器中都可以正常工作)。

Here is the HTML for the modal:这是模态的 HTML:

<!-- Spinner modal -->
    <div class="modal fade" id="spinner" role="dialog">
        <div class="modal-dialog">
            <!-- Modal content-->
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">Processing</h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-md-12">
                            <p>Your payment is being processed. Please do not close your browser window or click the back button. Doing so may incurr multiple charges.</p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12 text-center">
                            <img src="../images/icons/spinner.gif" />
                        </div>
                    </div>
                </div>
                <div class="modal-footer"></div>
            </div>
        </div>
    </div>

What is supposed to happen is that when an ajax call fires the spinner modal should be displayed while the web service is running.应该发生的是,当 ajax 调用触发时,应该在 Web 服务运行时显示微调模式。 It should stay on the screen until the complete event runs.它应该停留在屏幕上,直到完整的事件运行。 Here is the complete listing of the ajax call.这是 ajax 调用的完整列表。 In all instances the web service runs fine and returns a JSON string.在所有情况下,Web 服务都运行良好并返回一个 JSON 字符串。

// Record the payment
    jQuery.ajax({
        type: "POST",
        async: false,
        url: "/payments.asmx/ProcessPayment",
        contentType: "application/json; charset=utf-8",
        data: JSON.stringify({
            _paymentRecord: payment
        }),
        dataType: "json",
        "beforeSend": function () {
            // Display the wait graphic
            $("#spinner").modal("show");
        },
        "success": function (data) {
            // some code goes here which was removed to make the listing readable
        },
        "error": function (jqXHR, textStatus, errorThrown) {
            alert("Error executing web service: " + jqXHR.responseText);
        },
        "complete": function () {
            // Hide the spinner modal
            $("#spinner").modal("hide");
        }
    });

Remove "fade" from the class list.从班级列表中删除“淡入淡出”。 i have no idea why it doesn't work with fade but that fixed it for me.我不知道为什么它不能与淡入淡出一起工作,但这对我来说是固定的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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