/*----------------------------------------------------------------------------------- /* /* Init JS /* -----------------------------------------------------------------------------------*/ jQuery(document).ready(function () { $WIN = $(window); /* Preloader * -------------------------------------------------- */ var Preloader = function () { $WIN.on("load", function () { // will first fade out the loading animation $("#loader").fadeOut("slow", function () { // will fade out the whole DIV that covers the website. $("#preloader").delay(300).fadeOut("slow"); }); }); }; /*----------------------------------------------------*/ /* Adjust Primary Navigation Background Opacity ------------------------------------------------------*/ $(window).on("scroll", function () { var h = $("header").height(); var y = $(window).scrollTop(); var header = $("#main-header"); if (y > h + 0 && $(window).outerWidth() > 1020) { header.addClass("opaque"); } else { if (y < h + 200) { header.removeClass("opaque"); } else { header.addClass("opaque"); } } }); /*----------------------------------------------------*/ /* slider /*----------------------------------------------------*/ const SlickSlider = function () { $(".id-Slider").slick({ autoplay: true, autoplaySpeed: 5000, speed: 600, slidesToShow: 1, slidesToScroll: 1, pauseOnHover: true, dots: true, pauseOnDotsHover: true, cssEase: "linear", fade: true, draggable: true, prevArrow: '', nextArrow: '', // Custom Dots With Thumbnails Tool Tip customPaging: function (slider, i) { var thumbnail = $(slider.$slides[i]).data("thumbnail"); return ( '' ); }, }); }; // end SlickSlider /* WOW Scrolling * ------------------------------------------------------ */ var wow = new WOW({ boxClass: "wow", // animated element css class (default is wow) animateClass: "animated", // animation css class (default is animated) offset: 120, // distance to the element when triggering the animation (default is 0) mobile: false, // trigger animations on mobile devices (default is true) live: true, // act on asynchronously loaded content (default is true) callback: function (box) {}, scrollContainer: null, // optional scroll container selector, otherwise use window }); $(document).ready(function () { wow.init(); }); /* Smooth Scrolling * ------------------------------------------------------ */ const SmoothScroll = function () { $(".smoothscroll").on("click", function (e) { var target = this.hash, $target = $(target); e.preventDefault(); e.stopPropagation(); $("html, body") .stop() .animate( { scrollTop: $target.offset().top, }, cfg.scrollDuration, "swing" ) .promise() .done(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 // 공백제거 $(".table-nbsp").each(function () { var $this = $(this); $this.html($this.html().replace(/ /g, "")); }); // 코멘트 $(".table-comment").children().addClass("commentTable"); $(".commentTable table").addClass("commentInner"); $(".table-comment-write").children().addClass("commentWrite"); // 게시판 테이블에 인라인 스타일 제거 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")) { $(".brd_wrap link[rel=stylesheet]").remove(); $(".gallery_item_table_split").remove(); $(".brd_wrap img").css("height", "auto"); } if ($("td").hasClass("est_keyword_cell")) { $("#search_display1").css("display", "inline"); } const Board = function () {}; /* Initialize * ------------------------------------------------------ */ (function ssInit() { Preloader(); SlickSlider(); SmoothScroll(); })(); });