简体   繁体   中英

Fancybox default close does not work after form redirect

I've created my page using bootstrap and have a link to fire off a fancybox box as below:

<a class="iframe" href="AForm.asp?ID=<%=Request("ID")%>"><button class="btn-warning">Action Form</button></a>

JQuery

 <script type="text/javascript">
    $(document).ready(function() {
        $("a.iframe").fancybox({
            'type' : 'iframe', 
            'width':500,
            'height':500,
            'afterClose':function () {
        window.location.reload(); } 
        });
    });
</script>

The default functionality works fine to begin with: i can trigger fancybox to load, click the default cross icon and it closes the box - all working as expected.

When i submit a form within the fancybox (html/classic asp) and it does a redirect to a standard HTML page that literally just says "Please close this page" the default close cross icon does nothing. It is visible and in the correct place but there is no click functionality.

I have tried custom close buttons within the HTML page but nothing works - it just doesn't want to close at all. Anyone got any ideas? Thanks

Not so much an answer but after trying to fix this all day i gave up on Fancybox and found Colorbox to work pretty much out of the box for what i was trying to do. Colorbox

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