Linking an iframe to open in Lightbox

后端 未结 5 1824
梦如初夏
梦如初夏 2021-01-19 05:52

Is it possible to use a link to link to an iFrame of content that opens in a lightbox or fancybox?

EG; View my Graphic Design Gallery Click Here > Lightbox displayin

5条回答
  •  花落未央
    2021-01-19 06:15

    Lightbox is designed only for images but you can use fancybox.

    there are 2 ways to do it:

    $.fancybox({'href':'http://www.google.com',
      'type':'iframe'
    });
    

    or:

    google
    
    jQuery(document).ready(function () {
      $("#linktogoogle").fancybox();
    });
    

    Clicking on the link will load google in an iframe. if you want it to load without clicking :

     jQuery(document).ready(function () {
       $("#linktogoogle").fancybox().click();
     });
    

    You may also set the link visibility style to hidden.

提交回复
热议问题