ThickBox after any AJAX

Hi all,

My problem was that as happen with many the ThickBox stoped working after being rendered on AJAX (in my particular case using Prototype Framework).

Solution: on the bottom of  your xHTML answer, or making it simple, in the end of your partial render add this code:

script type="text/javascript" language="JavaScript" >
$(document).ready(function(){
tb_init('a.thickbox, area.thickbox, input.thickbox');
imgLoader = new Image();
imgLoader.src = tb_pathToImage;
});
/ script>

But if you are using jQuery.noConflict(); probably if you are playing with JQuery and Prototype on the same page, then replace ‘$’ with ‘jQuery’

The solution was found on this Forum: http://community.xajaxproject.org/viewtopic.php?id=5528, very smart guys

Tested on FF 3, IE 6,7

MAke some comment! Its open!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s