views:

20

answers:

1
$(".overlay").lightbox();

$('.overlay').live('click', function(e){
        e.preventDefault();
        var url  = base_url  + 'ajax/getcolorboxhotel';
         var data = $(this).next('span').text();
        $('.hiddencontent').load(url, {id:data});
    });

Please help! The code above works with links in the page while new links loaded by the .load() function do not do a lightbox anymore!

A: 

If the JQuery lightbox works anything like the normal one, you need to call lightbox() after every insertion of a new link.

This is because the lightbox loops through every link in the document, checks whether it has rel=lightbox, and adds the appropriate event handler to it that will then open the lightbox.

Pekka