I currently assign elemen开发者_如何转开发ts to Fancybox as follows:
$(document).ready(function(){
$(".popup").fancybox({
 'speedIn'  : 600, 
 'overlayOpacity'  : 0.7,
 'speedOut'  : 200
});
}); When I load remote content using $.post(), some of that content contains...
<a class="popup" href="#somebox">Click me</a>.
Clicking the link does nothing, probably because the document ready only gets processed once on page load. How can I 'reprocess' this so that links in the remote content open up the fancybox?
I've looked around must most of the solutions are ASP.net based. I am currently using standard PHP and jQuery.
Thanks.
You could set your own click event on these links, using .live():
$(".popup").live('click', function(){
  $.fancybox({
    'speedIn': 600, 
    'overlayOpacity': 0.7,
    'speedOut': 200,
    'href': $(this).attr('href')
  });
  return false;
});
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论