I’m using history plugin, below is my code:
1. When I click the link, browser address bar show-http://…/test.html#gallery-1, and if paste this address in another window it won’t auto open fancybox, why? Did I miss something?
2. How can I change the name after # ?
$(".subjectwrap").fancybox({
helpers : {
history : true
}
});
<a class="subjectwrap" href="#contentinline">
<img src="img/test.jpg" height="200">
</a>
<div class="contentwrap" style="display:none" id="contentinline">
Lorem ipsum dolor sit amet
<img src="img/1.jpg" height="200">
</div>
You have to set the name for the gallery – add “rel” or “data-fancybox-group” attribute. You can choose your own name and it will be used as hash (after #)
Demo – http://jsfiddle.net/FB7UW/