$(document).ready(function() { /*----------------------------------------------------*/ /* Adjust Primary Navigation Background Opacity ------------------------------------------------------*/ $(window).on('scroll', function() { var h = $('header').height(); var y = $(window).scrollTop(); var header = $('header'); if ((y > h + 0) && ($(window).outerWidth() > 1020)) { header.addClass('opaque'); } else { if (y < h + 100) { header.removeClass('opaque'); } else { header.addClass('opaque'); } } }); // HERO SLIDER var menu = []; $('.intro-slide').each(function(index) { menu.push(jQuery(this).find('.slide-inner').attr("data-text")); }); var interleaveOffset = 0.5; var swiperOptions = { loop: true, speed: 1000, parallax: true, autoplay: { delay: 6500, disableOnInteraction: false, }, watchSlidesProgress: true, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, on: { progress: function() { var swiper = this; for (var i = 0; i < swiper.slides.length; i++) { var slideProgress = swiper.slides[i].progress; var innerOffset = swiper.width * interleaveOffset; var innerTranslate = slideProgress * innerOffset; swiper.slides[i].querySelector(".slide-inner").style.transform = "translate3d(" + innerTranslate + "px, 0, 0)"; } }, touchStart: function() { var swiper = this; for (var i = 0; i < swiper.slides.length; i++) { swiper.slides[i].style.transition = ""; } }, setTransition: function(speed) { var swiper = this; for (var i = 0; i < swiper.slides.length; i++) { swiper.slides[i].style.transition = speed + "ms"; swiper.slides[i].querySelector(".slide-inner").style.transition = speed + "ms"; } } } }; var swiper = new Swiper(".swiper-container", swiperOptions); // DATA BACKGROUND IMAGE var sliderBgSetting = $(".slide-bg-image"); sliderBgSetting.each(function(indx) { if ($(this).attr("data-background")) { $(this).css("background-image", "url(" + $(this).data("background") + ")"); } }); /* Smooth Scrolling * ------------------------------------------------------ */ $('.smoothscroll').on('click', function(e) { e.preventDefault(); var target = this.hash, $target = $(target); $('html, body').stop().animate({ 'scrollTop': $target.offset().top }, 800, 'swing', function() { window.location.hash = target; }); }); /* Back to Top * ------------------------------------------------------ */ // declare variable var scrollTop = $(".scrollTop"); $(window).scroll(function() { // declare variable var topPos = $(this).scrollTop(); // if user scrolls down - show scroll to top button if (topPos > 100) { $(scrollTop).css("opacity", "1"); } else { $(scrollTop).css("opacity", "0"); } }); // scroll END //Click event to scroll to top $(scrollTop).click(function() { $('html, body').animate({ scrollTop: 0 }, 300); return false; }); // click() scroll top EMD // 게시판 테이블에 인라인 스타일 제거 if ($("div").hasClass("brd_wrap")) { $("tr").removeAttr("height"); $("td").removeAttr("width").removeAttr("align").removeAttr("height").removeAttr("style"); $("input").removeAttr("width").removeAttr("align").removeAttr("height").removeAttr("style").removeAttr("font"); $("font").removeAttr("style") }; // 게시판에 기본 링크되는 company.css 제거 if ($("div").hasClass("brd_wrap")) { $("#content .container link[rel=stylesheet]").remove(); $("brd_wrap img").css("height", "auto"); }; if ($("td").hasClass("est_keyword_cell")) { $("#search_display1").css("display", "inline"); }; // 공백제거 // $(".brd_wrap").each(function() { // var $this = $(this); // $this.html($this.html().replace(/ /g, '')); // }); // 공백제거 $(".table-nbsp").each(function() { var $this = $(this); $this.html($this.html().replace(/ /g, '')); }); /* Initialize * ------------------------------------------------------ */ (function ssInit() {})(); }); (jQuery);