/********************************************************************************* Ç÷¯±×ÀÎ : jquery.DB_tabFadeWide.js Á¦ÀÛÀÚ : µðÀÚÀÎºí·¢ , http://designblack.com ¾÷µ¥ÀÌÆ® : 2015-06-11 ¶óÀ̼¾½º : ¹«ÇѶóÀ̼¾½º Âü°í : ¹®¼­Á¤º¸´Â »èÁ¦ ÇÒ ¼ö ¾ø½À´Ï´Ù. *********************************************************************************/ !function(n){n.fn.DB_tabFadeWide=function(i){var e={motionSpeed:300,autoRollingTime:5e3,rollingType:0};return n.extend(e,i),this.each(function(){function i(){o(),t(),c(),s()}function o(){u.css({position:"relative"}),a.css({position:"absolute"}),a.hide(),a.eq(g).show()}function t(){r.bind("mouseenter",function(){clearInterval(v)}).bind("mouseleave",function(){c()}),l.bind("click",function(){g=n(this).index(),s()}),_.bind("mouseenter",function(){d(n(this).find("img"),"src","_off","_on")}).bind("mouseleave",function(){d(n(this).find("img"),"src","_on","_off")}).bind("click",function(){b="prev",g=0==g?h-1:--g%h,s()}),m.bind("mouseenter",function(){d(n(this).find("img"),"src","_off","_on")}).bind("mouseleave",function(){d(n(this).find("img"),"src","_on","_off")}).bind("click",function(){b="next",g=++g%h,s()})}function f(){0==e.rollingType?(g="next"==b?++g%h:0==g?h-1:--g%h,s()):(g=Math.floor(Math.random()*h),p==g?f():s())}function c(){v=setInterval(f,e.autoRollingTime)}function s(){a.eq(p).stop(!0,!0).fadeOut(e.motionSpeed),a.eq(g).stop(!0,!0).fadeIn(e.motionSpeed),d(l.eq(p).find("img"),"src","_on","_off"),d(l.eq(g).find("img"),"src","_off","_on"),l.eq(p).removeClass("DB_select"),l.eq(g).addClass("DB_select"),p=g}function d(n,i,e,o){var t=n.attr(i);-1!=String(t).search(e)&&n.attr(i,t.replace(e,o))}var r=n(this),u=r.find(".DB_img"),a=r.find(".DB_img li"),l=(r.find(".DB_menu"),r.find(".DB_menu li")),m=r.find(".DB_next"),_=r.find(".DB_prev"),h=a.length,g=0;1==e.rollingType&&(g=Math.floor(Math.random()*h));var p=999,v=0,b="next";i()})}}(jQuery);