... by reading Michael's docs a little more closely.

Into the document.ready block....
      Shadowbox.init({
        skipSetup:      true, // skip the automatic setup
    });


Into the getNextPage function

        Shadowbox.setup($('a.sbox'),{overlayOpacity: 0.8});


Apologies for not doing my homework properly.

Cheers,

Bruce



At 05:25 p.m. 30/01/2008, you wrote:
At 04:59 p.m. 30/01/2008, you wrote:
Any idea/suggestion to allow me to achieve what I'm seeking here?

Can you post a demo link?  That would be most helpful.

Sorry, I cannot do that for a couple of days.  Could we try it this way...

The following code retrieves new content into an existing page.

function getNextPage(ej) {
$.get("scripts/ajax_ramosus_client_second.asp?brm="+ej +"&q=" + new Date().getTime(), function(responseText){
        Shadowbox.init();
        $("#wrapper").html(responseText);
var options = {dataType: 'json', beforeSubmit: beforeAjax,success: afterAjax};

$('#ewlform,#quizform,#textform,#emailform,#glossform').submit(function() {$(this).ajaxSubmit(options); return false; });
        getTWidth('#sText','#textform');
$('a.styleswitch').bind("click", function(){switchStylestyle(this.getAttribute("rel"));return false;});var c = readCookie('RamosusStyle');if (c) switchStylestyle(c);
        $("a.link1").bind("click", function() {getFirstPage(this.id)});
        $("a.link2").bind("click", function() {getNextPage(this.id)});
        $("a.bmark").bind("click", function() {setBookmark(this.id)});
        $("a.email").bind("click", function() {getEmailForm()});
        $("a.emailh").bind("click", function() {hideEmailForm()});
        $("a.fsize").bind("click", function() {styleCycle()});
        $("a.logout").bind("click", function() {chkLogout(this.id)});
    //$.log('Shadowbox');
        });
};

That content contains one or two links of the form "<a href="an_image.jpg" rel="shadowbox">View this image</a>"

When any of those links are clicked, the expected shadow box functionality is not observed.

I realise that the example on Shadow Box's web site has the "init()" call in the document.ready block, but that isn't applicable here because of the new content that is being bought into the page (I did try including the Shadow.init() call in the document.ready block when the page is first called, but that didn't make any difference to the final outcome)

I hope this makes my context a little clearer,

Thanks,
Bruce

Reply via email to