I'm trying to fire Fancybox on elements which I append with jQuery, but with no success.
Here the Fancybox firing code:
jQuery(document).ready(function() {
$("a#what_is_prehung").fancybox();
$("a.prehungHelp").fancybox();
});
With this code I'm appending html markup:
jQuery(document).ready(function($) {
$('.valueDoorSlabonly').append('<div id="prehungHelp"><a class="prehungHelp" href="/template/images/door-slab-only.jpg"></a></div>');
});
I need to fire Fancybox on elements with class="prehungHelp". On our site we are using jQuery v1.6.4 and there is no way to update it due to other scripts working with this version only.
http://www.doorsandbeyond.com/avanti-modern-interior-door-black-apricot/ this is page where it should appear, in form with door option in "* Pre-hanging:" section right after radio buttons should "?" mark appear with link to modal window (fancybox) which is describing this option.
I've tried this answers and some others from several resources, but with no success: how to bind fancybox to dynamic added element? Appending dynamically generated html using jQuery does not play well with Fancybox
I'll appreciate any help. Thanks Sharif