2

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?

bytecode77
  • 14,163
  • 30
  • 110
  • 141

2 Answers2

5

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

$.fancybox.defaults.hash = false;
bytecode77
  • 14,163
  • 30
  • 110
  • 141
1

Well, it is kinda impossible to have two hashes at the same time, therefore fancyBox replaces with gallery hash, but restores original after closing. If this is causing trouble for you, then yes, disabling hash module would be best option.

btw, you can use gulp to build your own fancybox.js file without hash module; or you can pass hash: false option to disable (from v3.1).

Janis
  • 8,593
  • 1
  • 21
  • 27