0

I have a jquery fancybox and I call it from url with #

$(document).ready(function() {
    $('.fancybox').fancybox({
            openEffect : 'elastic',
            closeEffect: 'elastic',
            'type' : 'iframe',
            'overlayOpacity' : 0.1,
            'overlayShow' : false,
            'centerOnScroll' : true,
            'autoSize': false,
            'width' : 990,
            'height' : 780,
    });
    $('.contact').fancybox({
        openEffect : 'elastic',
        closeEffect: 'elastic', 
    });
    });

var thisHash = window.location.hash;
$(document).ready(function() {
 if(window.location.hash) {
  $(thisHash).fancybox().trigger('click');
 }
 $('.contact').fancybox();
}); // ready

I have managed to call it from url with # but the div containing the link for the fancy box becomes hidden when calling it from url. If you open the page without # calling it the div is shown(not hidden). Any ideas?

A.V.
  • 155
  • 1
  • 1
  • 11
  • Can you post a link to the site in question? – Blake Frederick Feb 05 '15 at 17:55
  • Your fancybox links (`.fancybox` and `.contact` selectors) should also have an ID that you must target with the *hash*. Notice you shouldn't target the ID of the `div` (via *hash*) containing the fancybox links – JFK Feb 05 '15 at 20:11
  • Check http://stackoverflow.com/a/9030970/1055987 for more – JFK Feb 05 '15 at 20:18

0 Answers0