라벨이 유튜브인 게시물 표시

유튜브 반응형 동영상 삽입

< script type = "text/javascript" > resizeYoutube();    $(window).resize(function(){resizeYoutube();});    $(function(){resizeYoutube();});    function resizeYoutube(){ $("iframe").each(function(){ if( /^https?:\/\/www.youtube.com\/embed\//g.test($(this).attr("src")) ){ $(this).css("width","100%"); $(this).css("height",Math.ceil( parseInt($(this).css("width")) * 480 / 854 ) + "px");} }); } </ script > < iframe width = "854" height = "480" src = "https://www.youtube.com/embed/a4IosLAbLXY" frameborder = "0" allowfullscreen = "" ></ iframe > 출처 http://sometimes-n.tistory.com/42 다 필요 없다... < div class = "videoArea" > < iframe ></ iframe > </ div > .videoArea { position : relative ; width : 100% ; height : 0 ; padding-bottom : 56.25% ;} .videoArea ifram...