javascript - Fancybox onClose not working - Stack Overflow

I am trying to redirect to the URL that is on my "onclose" attribute of the .fancybox ... it

I am trying to redirect to the URL that is on my "onclose" attribute of the .fancybox ... it just does work. Any ideas? Code is below. Note: the modal appears fine, but when the user presses the "x" at the top... the screen is just blank.

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


          function showModal() {


            var url = document.URL;
            var popUp = '//local.meau/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 = ".aspx";}

                });

            });



        }


    </script>  

I am trying to redirect to the URL that is on my "onclose" attribute of the .fancybox ... it just does work. Any ideas? Code is below. Note: the modal appears fine, but when the user presses the "x" at the top... the screen is just blank.

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


          function showModal() {


            var url = document.URL;
            var popUp = '//local.meau./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./Support-Center.aspx";}

                });

            });



        }


    </script>  
Share Improve this question asked Jul 16, 2013 at 21:12 Paul T. RykielPaul T. Rykiel 1,2276 gold badges27 silver badges52 bronze badges 1
  • maybe because the right name of the callback is onClosed (fancybox v1.3.4) – JFK Commented Jul 16, 2013 at 23:49
Add a ment  | 

1 Answer 1

Reset to default 5

updated your code to read

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

Double check your onClose callback as well

  • v1.2 - http://fancybox/api/126 - callbackOnClose
  • v1.3 - http://fancybox/api - onClosed
  • v2.0 - http://fancyapps./fancybox/#docs - beforeClose or afterClose

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744575453a4581711.html

相关推荐

  • javascript - Fancybox onClose not working - Stack Overflow

    I am trying to redirect to the URL that is on my "onclose" attribute of the .fancybox ... it

    2天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信