window.onload = function () { $('.header .nav>ul>li').hover(function () { $(this).find('ul').stop().slideToggle(); }); $("#back_top").click(function () { $("html,body").animate({ scrollTop: 0 }, 400); }); $('.activity_box li').each(function () { if ($(this).find('p').text().length < 28) { $(this).find('p').css({ 'line-height': '60px' }) } else { } }); $('.leftlist').height($('.subpage_content').height()); $('.tab_nav li').mouseenter(function () { if ($(this).is('.notice')) { $(this).addClass('active'); $('.activity').removeClass('active'); $('.activity_box').fadeOut(300); setTimeout(function () { $('.notice_box').fadeIn(); }, 300) } else { $(this).addClass('active'); $('.notice').removeClass('active'); $('.notice_box').fadeOut(300); setTimeout(function () { $('.activity_box').fadeIn(); }, 300) } }); var primemaxindex; var mySwiper = new Swiper('.swiper-container', { speed: 500, autoplay: 50000000, loop: true, grabCursor: true, paginationClickable: true, onFirstInit: function (swiper) { $('.swiper-wrapper>div').each(function () { primemaxindex = $(this).index(); }); }, onSlideNext: function (swiper) { var maxindex; $('.swiper-wrapper>div').each(function () { maxindex = $(this).index(); }); if ($('.swiper-slide-active').index() == maxindex - 1) { if (maxindex == primemaxindex + 1) { return false; } else { $('.swiper-wrapper').width((maxindex + 2) * 1400); var firsthtml = $('.swiper-slide').eq(2).html(); firsthtml = '
' + firsthtml + '
'; $('.swiper-wrapper').append(firsthtml); } } } }); }