Fancybox links don't show in lightbox - what am i missing?

后端 未结 1 1351
轻奢々
轻奢々 2020-11-22 12:20

Alright, I thought I implemented this correctly, but I guess I must\'ve goofed somewhere.

Here\'s my code:

Jquery here:

jQuery(document).read         


        
1条回答
  •  盖世英雄少女心
    2020-11-22 12:58

    This href="http://placehold.it/350x125" doesn't say to fancybox that you are opening an image so you either :

    1). add the fancybox.image special class to your link like

    
    

    2). add the (HTML5) data-fancybox-type attribute to your link like

    
    

    3). add the type option to your fancybox script like

    $(".fancybox").fancybox({
       type: "image"
    });
    

    whatever you think works better for your case.

    NOTE: numbers 1). and 2). above work for fancybox v2.x only. Number 3). works for either v1.3.4 and v2.x

    EDIT : included a JSFIDDLE with your code and jQuery v1.8.3.

    There are two links :

    • one using "fancybox.image" class : working
    • other without : not working

    0 讨论(0)
提交回复
热议问题