Thickbox and jquery

hi

I’ve got a site that i’m making and I have a weird issue.

I use thickbox to show the larger images which works create… and I use jquery for ajax requests that also works great.

now I’ve got a div with all the products… but if I refresh this div to hold a table with icons it all works … except for thickbox… somehow the thickbox images will not work anymore…

does anybody have an idea?

I’ve check the ajax return and it holds all the class info thickbox needs.

You have to attach your events with .live() or livequery plugin for the content that you are getting and showing via ajax.

I would replace class=“thickbox” with something like class=“thickboxAJAX” and then would attach the event via .live() method and show thickbox programmatically:


$('.thickboxAJAX').live('click', function(){
    var title = $(this).attr('title');
    var url = $(this).attr('href');
    tb_show(title, url);  
    return false;
});

Check this out for more details:
http://blog.gridworlds.com/js/working-with-thickbox