/* * Name: KEPCO * Part: JavaScript for ui & plug-in * Author : pk.choi */ (function($){ // jQuery.noConfict(); $(document).ready(function() { /* * Part: 인쇄광고 썸네일 드롭다운뷰 * Function: * 썸네일 클릭시 하단에 상세 뷰가 나옴 */ var clickedIndex = -1; var SPEED = 600; var EASING_ANIMATE = "easeInOutSine"; var $lists = $('.gallery_list_box .gallery_list>li'); var $boxes = $lists.find('.box_info'); var $arrows = $lists.find('dd.arrow'); $lists.each(function(index, element) { $(this).attr('rowIndex',Math.floor(index / 3)); $(this).find('.g_box').attr('id','moveThumb'+index); $(this).find('.g_box .thumb a') .attr('href','#moveThumb'+index) .css({'display':'block', 'width':223, 'height':155 }); if(index%3 == 1){ $(this).find('.box_info').addClass('posC'); } if(index%3 == 2){ $(this).find('.box_info').addClass('posR'); } }); $('.gallery_list_box dl.g_box .thumb a').on({ 'focusin':function (event) { $(this).parent().css({"height":"100%", "background":"#000"}); $(this).find('img').css({"opacity":"0.5"}); $(this).addClass('on'); } ,'mouseleave focusout':function (event) { $(this).parent().css({"background":"none"}); $(this).find('img').css({"opacity":"1"}); $(this).removeClass('on'); } }); $('.gallery_list_box dl.g_box .thumb a').on('click', function (event) { $.getJSON("/kepco/ntcob/fncGoHit.json",{boardSeq : $(this).attr("seq")}, function (returnJson) { }); var $li = $(this).parents('li'); var myIndex = $li.index(); var myRowIndex = $li.attr('rowIndex'); var $infoHeight = $li.find('.box_info').outerHeight(); //$(".gallery_list_box .gallery_list>li[rowIndex="+myRowIndex+"]").css('background-color','#ddd'); if(clickedIndex != myIndex){ $lists.css('height',211); $boxes.removeClass('on'); $arrows.removeClass('on'); $(".gallery_list_box .gallery_list>li[rowIndex="+myRowIndex+"]").css('height',$infoHeight + 260); $li.find('dd.arrow').addClass('on'); $li.find('.box_info').stop(true,true).addClass('on').css({'height':0}).animate({'height':$infoHeight},SPEED,EASING_ANIMATE).attr('tabindex','0').focus(); clickedIndex = myIndex; } return false; }); $('.gallery_list_box .box_info dd.close_box a').on('click', function () { $lists.css('height',211); $boxes.removeClass('on'); $arrows.removeClass('on'); clickedIndex = -1; return false; }); });//end : document ready })(jQuery);