SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Aug 2001
    Location
    Amsterdam
    Posts
    788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.
    the neigbours (free) WIFI makes it just a little more fun

  2. #2
    Learning...
    Join Date
    Jan 2003
    Posts
    781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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:

    Code:
    $('.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
    The beauty of life is not dependent on how happy you are,
    but on how happy others can be because of you...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •