Page 1 of 1

Help needed for fancybox ***SOLVED***

Posted: Wed Jun 05, 2019 9:14 am
by presto
I can link from one page (startpage) to a fancybox slide-show on a different page (secondpage) and run it with the link "page1.html#SlideShow1-1" The fancybox slideshow will open immediately. But how can I manage to go back automaticaly to the first page (startpage) when the fancybox is closed...?

This does not help

<script>
$(".fancybox-button fancybox-button--close" ).click(function() {
var url = "index.html";
$(location).attr('href',url);
});
</script>

Re: Help needed for fancybox ***SOLVED***

Posted: Wed Jun 05, 2019 10:04 am
by presto
Meanwhile I have found the solution myself:

<script>
$(document).on('beforeClose.fb', function( e, instance, slide ) {
var url = "index.html";
$(location).attr('href',url);
});
</script>

Re: Help needed for fancybox ***SOLVED***

Posted: Thu Jun 06, 2019 1:30 pm
by rogerl
or as part of the document-fancybox commands

Code: Select all

afterClose: function(){
    parent.location.href = "YourParentPage.html";
    },

Re: Help needed for fancybox ***SOLVED***

Posted: Fri Jun 07, 2019 4:15 pm
by presto
rogerl wrote: Thu Jun 06, 2019 1:30 pm or as part of the document-fancybox commands

Code: Select all

afterClose: function(){
    parent.location.href = "YourParentPage.html";
    },
Thanks a lot, works fine.Simply inserted as is in "Slide Show - General - Settings".