Dylan, I would contact Cody directly with this (if you haven't already), and put your proposal on the thickbox forum, as Cody is starting work on a new version:
http://codylindley.com/thickboxforum/comments.php?DiscussionID=90 http://codylindley.com/thickboxforum/comments.php?DiscussionID=90 Cheers, Dan Dylan Verheul wrote: > > I think I've seen this subject before, so I thought I'd share my solution. > > Case: > - I want to use Thickbox > - Some of my content is dynamically provided through AJAX > - The Thickbox urls in the AJAX content aren't thickboxed in > $(document).ready() > - Thickboxing twice gives me errors > > My solution: > I changed the TB_init from Thickbox to: > > function TB_init(elem) { > if (!elem) elem = document; > $("a.thickbox", elem).click(function() { > var t = this.title || this.name || null; > var g = this.rel || false; > TB_show(t,this.href,g); > this.blur(); > return false; > }); > } > > Now I can provide this function with a DOM element to search in. So > when I load content into <div id="ajaxHere"></div>, I can call > TB_init($("#ajaxHere")[0]). > > I might even extend this by adding a $.fn.thickbox that does this for > the entire jQuery chain to make it look better and play nice with > other jQuery stuff, but I'm hoping Cody might want to add some of this > into Thickbox. > > _______________________________________________ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > > -- View this message in context: http://www.nabble.com/Thickbox-2.0-and-dynamic-content-tf2213348.html#a6132633 Sent from the JQuery forum at Nabble.com. _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/