var carouseling = false; function leftCarousel() { if (carouseling) { return; } carouseling = true; var active = $('#BANNER_WRAP .carousel_inner .item.active'); var last = $('#BANNER_WRAP .carousel_inner .item').last(); active.before(last); var height = last.height(); $('#BANNER_WRAP .carousel_inner').css('top', '-'+height+'px'); $('#BANNER_WRAP .carousel_inner').animate({ 'top': 0 }, 500, function() { active.removeClass('active').prev().addClass('active'); carouseling = false; }); }; function rightCarousel() { if (carouseling) { return; } carouseling = true; var active = $('#BANNER_WRAP .carousel_inner .item.active'); var height = active.height(); $('#BANNER_WRAP .carousel_inner').animate({ 'top': '-=' + height }, 500, function() { active.removeClass('active').next().addClass('active'); // ¾Ö´Ï¸ÞÀÌ¼Ç ³¡³ª°í óÀ½ ¹è³Ê¸¦ ¸¶Áö¸·À¸·Î À̵¿ ½ÃÅ´ $('#BANNER_WRAP .carousel_inner').css('top', '0').append(active); carouseling = false; }); }; function autoCarousel() { setTimeout(function() { rightCarousel(); autoCarousel(); }, 3000); }; function initCarousel() { $('#BANNER_WRAP .carousel-control.left').click(function(event) { event.preventDefault(); leftCarousel(); return false; }); $('#BANNER_WRAP .carousel-control.right').click(function(event) { event.preventDefault(); rightCarousel(); return false; }); autoCarousel(); }; $(document).ready(function() { initCarousel(); if (!ALWAYS_OPEN) { if (REMEMBER_CLOSE && '1' == $.cookie('TODAY_BANNER_CLOSE')) { hideBanner(false); } else { setTimeout(function() { showBanner(); }, 1000); } } else { $('#BANNER_WRAP').css('margin', 0); } }); (function ($, document, undefined) { var pluses = /\+/g; function raw(s) { return s; } function decoded(s) { return decodeURIComponent(s.replace(pluses, ' ')); } var config = $.cookie = function (key, value, options) { // write if (value !== undefined) { options = $.extend({}, config.defaults, options); if (value === null) { options.expires = -1; } if (typeof options.expires === 'number') { var days = options.expires, t = options.expires = new Date(); t.setDate(t.getDate() + days); } value = config.json ? JSON.stringify(value) : String(value); return (document.cookie = [ encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value), options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE options.path ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', options.secure ? '; secure' : '' ].join('')); } // read var decode = config.raw ? raw : decoded; var cookies = document.cookie.split('; '); for (var i = 0, l = cookies.length; i < l; i++) { var parts = cookies[i].split('='); if (decode(parts.shift()) === key) { var cookie = decode(parts.join('=')); return config.json ? JSON.parse(cookie) : cookie; } } return null; }; config.defaults = {}; $.removeCookie = function (key, options) { if ($.cookie(key) !== null) { $.cookie(key, null, options); return true; } return false; }; })(jQuery, document);