1

I've successfully created some test pages using the Fancybox library.

However, when I try to integrate the library into the main site, instead of opening up an image in the modal window, it opens it in a separate tab/window/page.

The successful empty test is here: http://www.halal-helvetica.ch/kash.html

To get to the one that doesn't work, you need to go to: http://www.halal-helvetica.ch/index2.php, then search for Bern. Then click on the icon for a restaurant, and then click on the small grey square in the info area on the left of the screen. When you click that, you'll see that it opens up a large grey square in a new page instead of in the modal window.

I hope i've been specific enough.

Thanks Kash.

Kash.
  • 242
  • 1
  • 3
  • 15

1 Answers1

1

When you bind the Fancybox to a#single_image in base2.js, you're doing it on page load when there aren't any occurances of it. Later the element is created when a marker is clicked, so nothing is bound. The $.live() function of jQuery will bind on page load, but also bind any future matches through AJAX calls or whatever. This answer should help get $.live() working with Fancybox.

Hope that helps

Community
  • 1
  • 1
Tak
  • 11,428
  • 5
  • 29
  • 48
  • Thanks for the link Tak, and also explaining what the problem was. I simply replaced: `$(document).ready(function() {` with" `$(document).ajaxStop(function() {` – Kash. Jul 03 '11 at 00:41