0

I have the following pice of code but it is not working for me.

$('#seisUrl').html(""); // reset div.
    var urls = url, 
    filepath , filename;    

    for(var i=0;i<urls.length;i++){     
        if(urls[i] != ''){
            filename = basename(urls[i]);
            filepath = dirname(urls[i]);
            $('#seisUrl').append(
                    '<a rel="zoom-id:zoom; seismic" href="' + filepath + 'thumbnail_' + filename 
                    + '" rev="' + filepath + 'thumbnail_' + filename 
                    + '" class="fancyboxseismic"' 
                    +'></a>'
            );
        }
    }

    $(".fancyboxseismic").fancybox({
    });

The html output is

<div id="seisUrl" style="">
<a class="fancyboxseismic" rev="http://website-dev.uk.spectrumasa.com/mcmap//public/filespool/2/270/thumbnail_seismic_CroatianAdriatic3.jpg" href="http://website-dev.uk.spectrumasa.com/mcmap//public/filespool/2/270/thumbnail_seismic_CroatianAdriatic3.jpg" rel="zoom-id:zoom; seismic"></a>
<a class="fancyboxseismic" rev="http://website-dev.uk.spectrumasa.com/mcmap//public/filespool/2/270/thumbnail_seismic_CroatianAdriatic2.jpg" href="http://website-dev.uk.spectrumasa.com/mcmap//public/filespool/2/270/thumbnail_seismic_CroatianAdriatic2.jpg" rel="zoom-id:zoom; seismic"></a>
</div>

This seems to working fine on my curent site which you can find by browsing to http://www.spectrumasa.com/mcmap/large.php . then go to Meditttereanean-> Adriatic->Croatia. the problematic button is "seismic".

On my dev box i have updated fancybox to 2.1.5 version. I have changed the buttons from list items to normal a tags in a div. using css to style them inline. I have not changed anyother code but it seems like fancybox is not able to pick up the image classes. when i do view source after the images have been appended via jquery it is not there. howver i can see it in firbug console.

seems to work on here but doesn't seem to work on dev bnox

shorif2000
  • 2,582
  • 12
  • 65
  • 137

1 Answers1

0

I had a fancybox class where i shouldn't of had. it does work fine.

"<a class='btn'  href=\"#\"  onclick=\"trackFactsheetView("+surveyId+",\'seismic\');\" >Seismic</a>"

this link was calling another function which was triggering fancyboxseismic.

shorif2000
  • 2,582
  • 12
  • 65
  • 137