opening fancybox from inside jquery .load content
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;
});
精彩评论