在视频弹出窗口下方添加一些文本 [英] Adding some text below the video popup

查看:122
本文介绍了在视频弹出窗口下方添加一些文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在视频弹出窗口下方添加一些文本,例如示例图片:

我该怎么做?

我的代码:

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

解决方案

默认情况下,字幕仅适用于图像类型.

要使其与iframe类型一起使用,您需要将具有标题的元素添加到 iframe标记,然后在markupParse回调中对其进行解析,例如:

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

以下是示例 http://codepen.io/dimsemenov/pen/zjtbr

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'
    });
});

解决方案

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

这篇关于在视频弹出窗口下方添加一些文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆