8월, 2016의 게시물 표시

[jQuery] 시간 카운트

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script language="javascript"> $(document).ready(function(){ //초기값 var hour = 12; var minute = 00; var second = 2; // 초기화 $(".countTimeHour").html(hour); $(".countTimeMinute").html(minute); $(".countTimeSecond").html(second); var timer = setInterval(function () { // 설정 $(".countTimeHour").html(hour); $(".countTimeMinute").html(minute); $(".countTimeSecond").html(second); if(second == 0 && minute == 0 && hour == 0){ alert('타이머 종료.'); clearInterval(timer); /* 타이머 종료 */ }else{ second--; if(second<10){ $(".countTimeSecond").html('0' + second); } // 분처리 if(second == 0){ minute--; second = 59; } if(minute<10){ $(".countTimeMinute").html('0

유튜브 반응형 동영상 삽입

< 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