Now I wrote a standart code for loading iframe in window FancyBox. So I specified type iframe
and href
link with youtube params.
$.fancybox({
'type' : 'iframe',
'maxWidth': "90%",
'href' : href.replace(new RegExp('watch\?v=', 'i'), 'embed/') + '?theme=dark&color=white&autohide=1&rel=0&iv_load_policy=3&modestbranding=1&enablejsapi=1&showinfo=0&autoplay=1',
'padding' : 0,
'margin' : 0,
'autoCenter': false,
'scrolling' : 'no',
'fitToView' : false,
'width' : 950,
'overlayShow': true,
beforeLoad : function() {
var template;
var hash;
var info;
getVideo(id);
},
afterLoad:function(){
$('.fancybox-inner').append(template);
changeURL(matchYoutubeUrl(href)+'#'+id, info.VideoName, info);
},
helpers: {
overlay: {
locked: false
}
}
});
I need show iframe youtube and after it show any HTML code. How to do?
I tried in method:
afterLoad:function(){
// $('.fancy-content').html('<b>Any....</b>');
}
But this case clear my iframe...
Also tried:
afterLoad:function(){
$('.fancybox-inner').append(template);
}
It is works, but I dont see content, its hidden, the block .fancybox-inner
has height = 600px, but content is more than 600px, so I dont see...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…