Skip to main content


Provides hash-based navigation, closes Fancybox if it detects the use of the Back button in the browser. Monitors URL hash and looks for element with the same data name e.g. data-fancybox="gallery". Custom values are also supported using data-slug attribute, example:

<a  href=""  data-slug="cat"  data-fancybox="gallery">  <img src="" /></a>
<a  href=""  data-slug="dog"  data-fancybox="gallery">  <img src="" /></a>
<a  href=""  data-slug="bird"  data-fancybox="gallery">  <img src="" /></a>

To disable this plugin, set Hash: false or simply update defaults:

Fancybox.defaults.Hash = false;