我想在我的视频弹窗下面添加一些文字,就像例图一样。
我怎么做?
我的代码。
$(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
}
}