jQuery / Colorbox - create a separate link to open the colorbox?

后端 未结 4 473
一个人的身影
一个人的身影 2021-01-12 11:44

I\'m trying to open a jQuery Colorbox from a link outside the rest of the colorbox images. So, all of the examples look like this:



        
4条回答
  •  不知归路
    2021-01-12 12:15

    Here's a similar thing that worked for my project.

    HTML

    //I "display:none" the images gallery to hide them...
    
    
    //...then when I click on this JPG image the group of images (above) appear in a colorbox
    circle
    

    Here's the JQUERY

    $(document).ready(function(){
    
         //when i "click" on the image with a class of "circle1" it opens the "example1" group
         $('.circle1').click(function() {
            $("a[rel='example1']").colorbox({open:true});
         });
    
    });
    

提交回复
热议问题