/********************************************************************************* 플러그인 : jquery.DB_tabFadeWide.js 제작자 : 디자인블랙 , http://designblack.com 업데이트 : 2015-07-17 라이센스 : 무한라이센스 참고 : 문서정보는 삭제 할 수 없습니다. *********************************************************************************/ ;(function($){$.fn.DB_tabFadeWide=function(t){var u={motionSpeed:300,autoRollingTime:5000,rollingType:0};$.extend(u,t);return this.each(function(){var f=$(this);var g=f.find('.DB_img');var i=f.find('.DB_img li');var j=f.find('.DB_menu');var k=f.find('.DB_menu li');var l=f.find('.DB_next');var m=f.find('.DB_prev');var n=i.length;var o=0;var p=0;if(u.rollingType==1){o=Math.floor(Math.random()*n)}var q=999;var r=0;var s='next';init();function init(){setCss();setMouseEvent();setAnimation();$(window).resize(function(){resize()});window.onload=function(){resize()};resize()}function resize(){var h=i.eq(o).find('img').height();f.height(h)}function setCss(){i.hide();r=setInterval(changeCurrent,u.autoRollingTime)}function setMouseEvent(){k.bind('click',function(){o=$(this).index();setAnimation();p=1});m.bind('mouseenter',function(){setReplace($(this).find('img'),'src','_off','_off')}).bind('mouseleave',function(){setReplace($(this).find('img'),'src','_off','_off')}).bind('click',function(){s='prev';o=(o==0)?n-1:--o%n;setAnimation();p=1});l.bind('mouseenter',function(){setReplace($(this).find('img'),'src','_off','_off')}).bind('mouseleave',function(){setReplace($(this).find('img'),'src','_off','_off')}).bind('click',function(){s='next';o=++o%n;setAnimation();p=1})}function changeCurrent(){if(p==0){if(u.rollingType==0){if(s=='next'){o=++o%n}else{o=(o==0)?n-1:--o%n}setAnimation()}else{o=Math.floor(Math.random()*n);if(q==o){changeCurrent()}else{setAnimation()}}}p=0}function setAnimation(){i.eq(q).stop(true,true).fadeOut(u.motionSpeed);i.eq(o).stop(true,true).fadeIn(u.motionSpeed);setReplace(k.eq(q).find('img'),'src','_off','_off');setReplace(k.eq(o).find('img'),'src','_off','_off');k.eq(q).removeClass('DB_select');k.eq(o).addClass('DB_select');q=o}function setReplace(a,b,c,d){var e=a.attr(b);if(String(e).search(c)!=-1){a.attr(b,e.replace(c,d))}}})}})(jQuery);