Fancybox onClose not working

Fancybox onClose not working

本文关键字:working not onClose Fancybox      更新时间:2023-09-26

我正试图重定向到.fancybox的"onclose"属性上的URL……它确实有效。有什么想法吗?代码如下。注意:模态看起来不错,但当用户按下顶部的"x"时。。。屏幕上一片空白。

<script type="text/javascript">
 showModal();

          function showModal() {

            var url = document.URL;
            var popUp = '//local.meau.com/Support-Center/Service-Notifications/Search-Tips.aspx';
            var site = popUp;

            $(document).ready(function () {
                $.fancybox({
                    'width': 500,
                    'height': '55%',
                    'autoScale': false,
                    'transitionIn': 'none',
                    'transitionOut': 'none',
                    'type': 'iframe',
                    'href': site,
                    'showCloseButton': true,
                    'onClose' : function(){location.href = "http://local.meau.com/Support-Center.aspx";}
                });
            });

        }

    </script>  

更新代码以读取

window.location = "http://local.meau.com/Support-Center.aspx"

仔细检查onClose回调以及

  • v1.2-http://fancybox.net/api/126-callbackOnClose
  • v1.3-http://fancybox.net/api-onClosed
  • v2.0-http://fancyapps.com/fancybox/#docs-beforeCloseafterClose