【问题标题】:Adding some text below the video popup在视频弹出窗口下方添加一些文本
【发布时间】:2014-01-08 03:01:47
【问题描述】:

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

我该怎么做?

我的代码:

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

【问题讨论】:

    标签: javascript jquery magnific-popup


    【解决方案1】:

    默认情况下,标题仅适用于图像类型。

    要使其与iframe 类型一起使用,您需要添加将持有标题的元素iframe markup 并在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

    【讨论】:

    • 感谢您的回答,但我无法了解如何将其与“打开”功能一起使用。 $('.video').magnificPopup.open 可以这样使用吗?因为我想用页面加载来展示它们。不要点击某些东西来打开它。
    猜你喜欢
    • 2021-02-05
    • 2016-05-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-21
    • 2013-04-14
    • 1970-01-01
    相关资源
    最近更新 更多