0
votes

Hi ive loaded some content using the .load jquery function, in this content theres a fancybox image gallery but i cant get it to work from inside the loaded content ( it works fine by itself ).

any ideas ?

heres the code ive used for the fancybox

<script type="text/javascript">
    $(document).ready(function()
        $("a[rel=quest]").fancybox();   
    });
</script>

Regards Sam

2
you're missing a { after .ready(function(). - Andy

2 Answers

0
votes

Try this one instead

$(document).ready(function(){
    $("a[rel=quest]").fancybox();   
});

You're missing one bracked after function()

0
votes

You have to initialize fancybox again for the newly loaded links.

Or you could use http://docs.jquery.com/Plugins/livequery as suggested here: http://code.google.com/p/fancybox/issues/detail?id=18


try this:

$("#choose_design_service").click(function(){ 
    $("#hiw-content-area").load("pages/hiw/what_we_need_from_you.html",function(){
        $(this).find('a[rel=quest1]').fancybox(); 
    });
    return false; 
});