Hi Dan,
In the success callback of the ajax request, you can call the fancybox
or cluetip method on the links within the ajaxed content:
For example, using $.get() :
$.get('/test/ajax-test.xml', function(content){
// dump your new content
$('newcontentcontainer a[rel=facebox]').facebox(); // < --- call
fancybox again.
});
You'll need to replace "newcontentcontainer" with the real selector
for the element, of course.
--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Dec 19, 2008, at 10:56 AM, danfreak wrote:
Hey guys,
I came across this problem a few times and I'm sure there is an easy
fix.
Well...
THE PROBLEM
------------------------
on bottom of a certain HTML page I call a jQuery plugin, let's say
cluetip or fancybox.
as follows
<script type="text/javascript" src="/js/shared/
jquery.fancybox-1.0.0.js"></script>
<script trype="text/javascript">
jQuery('a...@rel*=fancybox]').fancybox();
</script>
Everything works fine... since I don't append something on the page
after an Ajax request, that needs fancybox again.
It's like, in this case, fancybox, doesn't notices the new element in
the page with the attribute <a ... rel="fancybox">my item</a>
How can I then I guess "reinstanciate" the plugin?
Cheers in advance!
Dan