window.onload = function () { $('.header .nav>ul>li').hover(function () { $(this).find('ul').stop().slideToggle(); }); $(".shell_img").each(function () { $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw = $(this).width(); $bh = $(this).height(); b1 = $w / $h; b2 = $bw / $bh; if (b1 > b2) { $img.css("height", "100%") $wed = $bh * b1; $img.css("width", $wed + "px") fz = ($(".shell_img").width() - $wed) / 2; $img.css("margin-left", fz + "px") } else { $img.css("width", "100%") $hed = $bw / b1; $img.css("height", $hed + "px") fs = ($(".shell_img").height() - $hed) / 2; $img.css("margin-top", fs + "px") } }); $("#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 windowW = $(window).width(); if (windowW > 414) { var mySwiper = new Swiper('.swiper-container', { slidesPerView: 4, speed: 500, loop: true, grabCursor: true, }) $('.lgo').on('click', function (e) { e.preventDefault() mySwiper.swipePrev() }) $('.rgo').on('click', function (e) { e.preventDefault() mySwiper.swipeNext() }) } else { var mySwiper = new Swiper('.swiper-container', { slidesPerView: 1, speed: 500, loop: true, grabCursor: true, autoplay: 2000 }) $('.lgo').on('click', function (e) { e.preventDefault() mySwiper.swipePrev() }) $('.rgo').on('click', function (e) { e.preventDefault() mySwiper.swipeNext() }) } }