Adding some text below the video popup

风流意气都作罢 提交于 2019-12-21 21:31:23

问题


I want to add some text below the my video popup, like the example picture:

How can I do that?

My code:

$(document).ready(function () {
    $.magnificPopup.open({
        items:[
            {
                src: 'http://www.youtube.com/watch?v=p_I70TYm9qQ',
                type:'iframe'
            },
        ],
        type: 'iframe'
    });
});

回答1:


By default caption works only with image type.

To make it work with iframe type, you'll need to add element that will hold title to iframe markup and parse it in markupParse callback, e.g.:

callbacks: {
  markupParse: function(template, values, item) {
   values.title = item.el.attr('title'); // will use title attribute of target DOM element
  }
}

Here is example http://codepen.io/dimsemenov/pen/zjtbr



来源:https://stackoverflow.com/questions/20986219/adding-some-text-below-the-video-popup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!