开发者

opening fancybox from inside jquery .load content

开发者 https://www.devze.com 2023-04-12 12:59 出处:网络
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 co开发者_StackOverflow社区ntent ( it works

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 co开发者_StackOverflow社区ntent ( 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


Try this one instead

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

You're missing one bracked after function()


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; 
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号