Thursday, August 7, 2008

Ajax and Smoothbox problem persists

We've tried a ton of different things to get this to work, but it's just not working! Today I will rewrite the ajax to come from mootools framework, instead of my own script, with the hopes that the html returned will be able to use smoothbox.

The closest solution we found, and attempted to implement (unsucessfully) was found in the comments on the smoothbox web page.

# Pietr Says:
2008-04-01 at 10.32 am

There is a problem when you dynamically load content via AJAX into a div or span. If you have a link with the smoothbox class inside, it is not possible anymore to use the smoothbox, as it seems that the new element is not being regcognized as a smoothbox element. The link is just opened in the current window, and not in a smoothbox. How can this be circumvented? (A sort of “reindexing” of the smoothbox elements would be required I think.)

Then:

# Boris Says:
2008-04-01 at 10.33 am

Just run TB_init() after you AJAX call.
---------------------------------------------------

So we tried to run TB_init() in a bunch of different ways, but still no luck! Will update with results.

BFN

1 comment:

Unknown said...

Try adding width and height in the url!
(e.g. bla.html?widht=400&height=350)
Helped for me. I think Smoothbox should be more flexible though.