Re-linking images following an ajax partial page load

44 views
Skip to first unread message

FragMeister

unread,
Feb 10, 2009, 7:14:43 PM2/10/09
to Slimbox
I am using Slimbox for the first time, so please bear with me if I am
a little slow!

I have a website where one of the div's is being changed by "load"ing
a new file in when links are clicked (using jQuery)

In the new files, there are anchors with the rel="lightbox" tag, but I
am not sure how to get Slimbox to refresh itself now that the contents
of the page has been changed by the ajax update.

I tried adding jQuery().slimbox(); to my javascript function after the
my "content" div has been updated by the new html, but this is
invoking the slimbox overlay immediately, rather than just setting up
slimbox to work with the new pictures now in the page.

thanks;

FragMeister

unread,
Feb 11, 2009, 4:20:09 PM2/11/09
to Slimbox
Fixed it, so thought I would provide details incase it helps anyone
else in a similar situation.

In my page, I was replacing the #content div with the replacement code
(using the jQuery .load function)

I was almost correct to add jQuery().slimbox(); but I think that
because slimbox had already been initialised when the whole page was
first loaded, this caused the problem.

By only invoking slimbox on anchors *now* in the #content div, rather
than on the whole page, it is fine@

jQuery("#content a").slimbox();
Reply all
Reply to author
Forward
0 new messages