vavavr00m / galleriffic

Automatically exported from code.google.com/p/galleriffic
1 stars 0 forks source link

how to make galleriffic work in an ajax container #242

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

I am using ajax to load a modal window, in which galleriffic should work. The 
content is loaded but the script is not working.
 As I read here: http://trentacular.com/2009/02/galleriffic-1-0/ I have to 
"You will need to initialize Galleriffic in the callback function of your AJAX 
load method responsible for retrieving the inner page content."

Here is my load method:
jQuery(function ($) {
    $('.basic').click(function (e) {
        $('#basic-modal-content').load('http://www.padis.ro/dev/fotografie/cetatile-radesei/ #content').modal();

        return false;
    });
});

I couldn't figure out how to initialize it correct. 
Eventually I changed this line:
jQuery(document).ready(function($) {
to
$("#basic-modal-content").ajaxComplete(function(){

This make gallerffic load the first image, the first time the modal window 
loads. Then no other image is shown, not even the first one if I try again 
without refreshing the page. The rest of the script seems to be working (thumbs 
have effects, slideshow advances, although no image is shown). 

How can I initialize gallerific after the content was loaded?

What version of the product are you using? On what operating system?
I am using galeriffic version: '2.0.1' on an wordpress site. Images are hosted 
on imageshack.com, not at my server. 

Original issue reported on code.google.com by alexandr...@gmail.com on 6 Sep 2011 at 3:33