;(function (win, $) {
$('.evt_banner_lst').slick({
slidesToShow: 1,
slidesToScroll: 1,
autoplay: true,
autoplaySpeed: 4000,
arrows: true,
prevArrow: '',
nextArrow: '',
infinite: true,
cssEase: 'cubic-bezier(0.76, 0, 0.24, 1)'
}).hover(
function() {
$(this).find('.slick-prev').stop().animate({
'opacity' : '1',
'margin-left' : '-722px'
},300);
$(this).find('.slick-next').stop().animate({
'opacity' : '1',
'margin-left' : '722px'
},300)
}, function() {
$(this).find('.slick-prev').stop().animate({
'opacity' : '0',
'margin-left' : '-772px'
},300);
$(this).find('.slick-next').stop().animate({
'opacity' : '0',
'margin-left' : '772px'
},300)
}
);
$('.banner_lst1').slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: true,
prevArrow: '',
nextArrow: '',
infinite: true,
asNavFor: '.info_lst1'
});
$('.info_lst1').slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
fade: true,
focusOnSelect: true,
asNavFor: '.banner_lst1'
});
$('.banner_lst2').slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: true,
prevArrow: '',
nextArrow: '',
infinite: true,
asNavFor: '.info_lst2'
});
$('.info_lst2').slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
fade: true,
focusOnSelect: true,
asNavFor: '.banner_lst2'
});
$('.gm_story_container .tabs_cont').slick({
slidesToShow: 1,
slidesToScroll: 1,
autoplay: true,
autoplaySpeed: 4000,
speed: 0,
arrows: false,
fade: true
});
$('.gm_story_container .tabs_cont').on('beforeChange', function(event, slick, currentSlide, nextSlide){
var nextNav = $('.tab_lst li').eq(nextSlide);
nextNav.addClass('selected').css('background','url(../img/'+nextNav.data('bg-selected')+') no-repeat').siblings('.selected').removeClass('selected').each(function () {
$(this).css('background','url(../img/'+$(this).data('bg')+') no-repeat')
});
});
$('.tab_lst a').click(function (e) {
e.preventDefault();
$('.gm_story_container .tabs_cont').slick('slickGoTo',$(this).parent().index())
}).hover(function () {
$(this).parent().addClass('hover').css('background','url(../img/'+$(this).parent().data('bg-selected')+') no-repeat')
},function () {
if(!$(this).parent().hasClass('selected')){
$(this).parent().css('background','url(../img/'+$(this).parent().data('bg')+') no-repeat')
}
$(this).parent().removeClass('hover')
});
$('.cash_itm').hover(function () {
$(this).find('.cash_detail_cont').stop().fadeToggle(200);
});
$(win).on('load scroll', function() {
var initPosition = $(win).scrollTop();
if (initPosition > ($('.login_bar_container').position().top + $('.login_bar_container').outerHeight() - $('header').outerHeight())) {
$('header .btn_gamestart').stop().fadeIn(100);
$('header .gnb_util').stop().fadeOut(100);
} else {
$('header .btn_gamestart').stop().fadeOut(100);
$('header .gnb_util').stop().fadeIn(100);
}
});
$('.cash_itm_tit').truncate({
maxHeight: 64,
lines: 2
});
$('.evnt_banner_lst').hover(
function() {
$(this).find('.slick-prev').stop().animate({
'left' : '27px',
},300);
$(this).find('.slick-next').stop().animate({
'right' : '27px'
},300)
}, function() {
$(this).find('.slick-prev').stop().animate({
'left' : '0'
},300);
$(this).find('.slick-next').stop().animate({
'right' : '0'
},300)
}
);
})(window, window.jQuery);