Search code examples
javascriptjqueryhtmlfancyboxfancybox-3

Using Fancybox 3 when "#" is already part of URL


Fancybox 3 uses the hashtag to persist the current view in the URL:

http://example.com/sites/site1#gallery-1

However, this is too bad for a site where navigation already requires hashtags:

http://example.com/#/sites/site1

Fancybox 3 will replace this to

http://example.com/#gallery1

Is there a way to use both this navigation and Fancybox 3 at the same time?


Solution

  • It seems like Fancyapps anticipated this and added an option for it that works smoothly:

    $.fancybox.defaults.hash = false;