\"); resizeImg_030F($(\"#adpnut_030F\").find(\".adList\").eq(adIndex).find(\".thumb\").find(\"a\"),data.result.data[l_bestnow_posi].imgurl);/*이미지 가운데 정렬을 위한 함수실행*/ } datainput_030F(true);/*추천기사 있을때*/ } else { datainput_030F(false);/*추천기사 없을때*/ } }, error: function(xhr, status, error) { datainput_030F(false);/*추천기사 없을때*/ } }); };/*이미지 비율 유지한채로 가운데정렬시키기위한 함수*/function resizeImg_030F(obj,src){ var sImgWidth, sImgHeight, sTagWidth, sTagHeight, sTag, sImg, sRatio, sRatioStandard, sImgSrc, sGapW, sGapH; sTag = $(obj); sImgSrc = src; sTag.html(\"\"); sImg=sTag.find('img'); sImg.on('load',function(){ sTagWidth = sTag.width(); sTagHeight = sTag.height(); sImgWidth = sImg.width(); sImgHeight = sImg.height(); sRatio = sImgWidth / sImgHeight; sRatioStandard = sTagWidth / sTagHeight; if(sRatio >= sRatioStandard) { sImg.css({ width: 'auto', height: '100%' }); }else{ sImg.css({ width: '100%', height: 'auto' }); } /* 가운데 */ sTagWidth = sTag.width(); sTagHeight = sTag.height(); sImgWidth = sImg.width(); sImgHeight = sImg.height(); sGapW = (sTagWidth - sImgWidth) / 2; sGapH = (sTagHeight - sImgHeight) / 2; if(sRatio < 1) { sGapH = 0; } sImg.css({ position:\"absolute\", left: sGapW, top: sGapH }); });}function dpTime(){ var now = new Date(); hours = now.getHours(); minutes = now.getMinutes(); seconds = now.getSeconds(); if (hours > 12) { hours -= 12; ampm = \"오후 \"; } else { ampm = \"오전 \"; } if (hours < 10){ hours = \"0\" + hours; } if (minutes < 10) { minutes = \"0\" + minutes; } if (seconds < 10) { seconds = \"0\" + seconds; } $(\"#adpnut_030F\").find(\".time\").html(ampm + hours + \":\" + minutes + \":\" + seconds); }function getWeather(){ var now = new Date(); var years = now.getFullYear(); var month = now.getMonth()+1; if(month == 13) { month = 1; } if((month+\"\").length < 2) { month = \"0\"+month; } var days = now.getDate(); if((days+\"\").length < 2) { days = \"0\"+days; } var hours = now.getHours(); if(hours%3 != 0) { hours = hours-(hours%3); } if((hours+\"\").length < 2) { hours = \"0\"+hours; } var filename = years+\"-\"+month+\"-\"+days+\"-\"+hours; $.ajax({ type: \"GET\", async: true, url: \"//api.ad4989.co.kr/weather/\"+filename+\".txt\", cache: false, dataType: \"jsonp\", jsonpCallback: \"myCallback\", success: function(data) { var weather_html = \"\"; var weather_icon = \"\"; var color_class = \"\"; $.each(data,function(index,item){ switch(item[0].wfKor){ case \"맑음\": weather_icon = \"\"; break; case \"흐림\": weather_icon = \"\"; break; case \"구름 많음\": weather_icon = \"\"; break; case \"비\": weather_icon = \"\"; break; case \"눈\": weather_icon = \"\"; break; case \"비/눈\": weather_icon = \"\"; break; case \"소나기\": weather_icon = \"\"; break; } if(Math.floor(item[0].temp) >= 0) { color_class=\"blue\"; } else { color_class=\"red\"; } weather_html = weather_html + \"\"+index+\"  \"+Math.floor(item[0].temp)+\"℃\"+\"  \" +weather_icon+\"
\"; }); $(\"#adpnut_030F\").find(\".weather\").append(\"\"+weather_html+\"
\"); $('.slider').bxSlider({ mode : \"vertical\", auto: true, speed:500, controls:false, }); }, error: function(xhr, status, error) { ; } });}