0

I am using Pikachoose image gallery. And I want to open a fancybox on one image in which I want to show a youtube video. I have already used this code

$(document).ready(function (){
    var a = function(self){
       self.anchor.fancybox();
    };
    $("#pikame").PikaChoose({buildFinished:a});
});

But this code added fancybox to all images in slider. How can I add fancy box to only one image? Thanks in advance..

4

1 に答える 1

0

コードは次のようになります。

$(document).ready(function (){
     var a = $('#pikame li').first().find('a:first').fancybox();
     // or try using the following line
     // var a = $("a.various").fancybox(); 
     $('#pikame').PikaChoose({buildFinished:a});
});
于 2012-07-24T07:12:46.340 に答える