var IvyproductRoller = { bannerMax: 0, bannerNow: 1, nowScrollLeft : 0, productInterVal : null, bannerInit : function() { $(".productCtrl .play").css({"display":"none"}); $(".productZone ul").bind({ mouseenter: function() { IvyproductRoller.bannerStop(); }, mouseleave: function() { IvyproductRoller.bannerStart(); } }); $(".productZone ul a").bind({ focus: function() { IvyproductRoller.bannerStop(); }, blur: function() { IvyproductRoller.bannerStart(); } }); IvyproductRoller.bannerStart(); }, bannerPrev : function() { var _this = this; _this.bannerStop(); $(".productZone ul li:first-child").before( $("
  • ").html($(".productZone ul li:nth-child("+bannerMax+")").html()) ); $(".productZone ul li:nth-child("+(bannerMax+1)+")").remove(); }, bannerNext : function() { var _this = this; _this.bannerStop(); _this.bannerRoll(); }, bannerStop : function() { window.clearInterval(productInterVal); $(".productCtrl .play").css({"display":"none"}); $(".productCtrl .stop").css({"display":"none"}); }, bannerStart : function() { bannerMax = $(".productZone ul").children("li").length; productInterVal = window.setInterval(function(){ IvyproductRoller.bannerRoll(); }, 500000); $(".productCtrl .play").css({"display":"none"}); $(".productCtrl .stop").css({"display":"none"}); }, bannerRoll: function() { var _this = this; obj = $(".productZone ul").children("li:first-child"); wid = $(obj).outerWidth(); $(".productZone ul").animate({ "left" : "-"+wid+"px" }, "slow", function() { $("
  • ").html($(".productZone ul li:first-child").html()).appendTo( $(".productZone ul") ); $(".productZone ul li:first-child").remove(); $(".productZone ul").css("left","0px"); $(".productZone ul").animate({ "left" : "0px" }, "fast", function() { $(".productZone ul").animate({ "left" : "0px" }, "fast", function() {}); }); }); } }; $(document).ready(function(){ intterValTime = 0; if ( location.host == "api.phnet.kr" ) intterValTime = 100; window.setTimeout(function(){ IvyproductRoller.bannerInit(); },intterValTime); });