Reply – Re: Documents loaded through ajax, shadowbox not working
Your Name
Subject
Message
or Cancel
In Reply To
Re: Documents loaded through ajax, shadowbox not working
— by Hbod Hbod
Hello Zain,

don't worry.... i'm sitting here since 6 hours to get this work. And now i got it.

Shadowbox.init; or Shadowbox.init(); doensn't work, because we aren't allowed to call this init more then 1 time.

But this works:

Shadowbox.init({ skipSetup: true }); Shadowbox.setup();

Thats it.

My Script (yui shadowbox, mootools ajax)

function callAJAX(pageid) {
        var url = "index.php?article_id=11&pageid=" + pageid;

        new Fx.Tween('left',{
                        onComplete: function(){
                                new Request.HTML({
                                        method: 'get',
                                        update: $('left'),
                                        url: url,
                                        onSuccess: function(responseText, responseXML){
                                                Shadowbox.init({ skipSetup: true }); Shadowbox.setup();
                                                new Fx.Tween('left').start('opacity', '0', '1');
                                        }
                                }).send();
                        }
                }).start('opacity', '1', '0');
        return false;
}