I have a website that uses the ajax parameter for Fancybox v2 to display certain bits of information, such as help, contact information, etc. I noticed a problem with it, however, when it works normally on the first click, it usually does not work correctly on subsequent clicks - the actual pop-up may appear for a while and then disappear, or it may never appear at all, and the overlay may load two or three times, so it takes a few clicks to clear it.
It doesnβt matter if you click on the same link or a different link that also uses Fancybox. Firebug Console does not report errors. If you refresh the page, you get another reliable click, and then subsequent clicks again show strange behavior.
I created a stripped-down version of one of our pages (deleting all other scripts) to see if there is something that causes a conflict, but that doesn't seem to be the case. You can look here:
http://frontandback.com.au/fancytest/
In the three links in the upper right corner of the site, Fancybox applies to them. Example:
<ul> <li><a href="index.html" data-fancybox-href="index.html #main" target="_blank" class="fancybox fancybox.ajax">Contact us</a></li> <li><a href="index.html" data-fancybox-href="index.html #main" target="_blank" class="fancybox fancybox.ajax">Help</a></li> <li><a href="index.html" data-fancybox-href="index.html #main" target="_blank" class="fancybox fancybox.ajax">FAQs</a></li> </ul>
If anyone has suggestions as to what causes this odd problem, it would be very helpful.
Greetings.
source share