new WOW().init(); var app = function () { var body = void 0; var menu = void 0; var menuItems = void 0; var init = function init() { body = document.querySelector('body'); menu = document.querySelector('.menu-icon'); menuItems = document.querySelectorAll('.nav__list-item'); applyListeners(); }; var applyListeners = function applyListeners() { //menu.addEventListener('click', function () { return toggleClass(body, 'nav-active'); }); }; var toggleClass = function toggleClass(element, stringClass) { if (element.classList.contains(stringClass)) element.classList.remove(stringClass); else element.classList.add(stringClass); }; init(); }(); $(document).ready(function () { $(window).scroll(function () { if ($(this).scrollTop() > 350) { $('#totop').fadeIn(); } else { $('#totop').fadeOut(); } }); $("#mainav li").hover(function (e) { $(this).find(".submenu").fadeIn(); }, function (e) { $(this).find(".submenu").fadeOut(); }); $('#totop').click(function () { $('#totop').addClass("fly"); $('#totop').find("img").attr("src", "img/fly.png"); var myMusic = document.getElementById("myMusic"); myMusic.play(); $("html, body").animate({ scrollTop: 0 }, 1000, function () { $('#totop').removeClass("fly"); $('#totop').find("img").attr("src", "img/totop.png"); }); return false; }); $("#btnShowVideo").click(function (e) { e.preventDefault(); var url = $(this).attr("href"); $("#adVideo").attr("src", url); myVideo = document.getElementById("adVideo"); myVideo.play(); $("#videoShow").fadeIn(); }); $("#videoShow").click(function () { $("#videoShow").fadeOut(); }); $("li.hasNav>a").click(function (e) { e.preventDefault(); $(this).closest("li").toggleClass("openNav").children(".mSubNav").slideToggle(); }); // qqservice var offset = 220; var duration = 500; jQuery(window).scroll(function () { if (jQuery(this).scrollTop() > offset) { jQuery('.back-to-top').fadeIn(duration); } else { jQuery('.back-to-top').fadeOut(duration); } }); jQuery('.back-to-top').click(function (event) { event.preventDefault(); jQuery('html, body').animate({ scrollTop: 0 }, duration); return false; }); var timer; var ctimer; $(".conbox>a").hover(function () { $(".conbox div.con-content").hide(); clearTimeout(ctimer); $(this).next("div").show(); }, function () { var curdiv = $(this).next("div"); timer = setTimeout( function () { curdiv.fadeOut(); }, 300); }); $(".conbox div.con-content").hover(function () { clearTimeout(timer); }, function () { var curdiv = $(this); ctimer = setTimeout( function () { curdiv.fadeOut(); }, 300) }); });