Help needed for fancybox ***SOLVED***

Issues related to previewing and publishing your web site.
Post Reply
presto
 
 
Posts: 138
Joined: Tue Aug 24, 2010 5:19 pm
Contact:

Help needed for fancybox ***SOLVED***

Post 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>
Last edited by presto on Wed Jun 05, 2019 12:18 pm, edited 1 time in total.
presto
 
 
Posts: 138
Joined: Tue Aug 24, 2010 5:19 pm
Contact:

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

Post 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>
User avatar
rogerl
 
 
Posts: 196
Joined: Tue May 03, 2016 8:24 am

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

Post by rogerl »

or as part of the document-fancybox commands

Code: Select all

afterClose: function(){
    parent.location.href = "YourParentPage.html";
    },
presto
 
 
Posts: 138
Joined: Tue Aug 24, 2010 5:19 pm
Contact:

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

Post 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".
Post Reply