jquery - How show iframe with content below at FancyBox? -
now wrote standart code loading iframe in window fancybox. specified type iframe
, href
link 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 , after show html code. how do? tried in method:
afterload:function(){ // $('.fancy-content').html('<b>any....</b>'); }
but case clear iframe...
also tried:
afterload:function(){ $('.fancybox-inner').append(template); }
it works, dont see content, hidden, block .fancybox-inner
has height = 600px, content more 600px, dont see...
try refresh fancybox (your iframe needs placed within "fancybox-inner" , display block create work) 1 time iframe loaded (no need wait until loaded if iframe has static height).
afterload:function(){ $('.fancybox-inner').append(template); //resize fancybox $.fancybox.update(); }
an other solution is, load iframe .fancybox-inner
in beforeload
-event function. in way, fancybox should size content right.
jquery fancybox fancybox-2
No comments:
Post a Comment