$(function(){ var nav_slide_timer; $("header .nav-list ul li.nav-dropdown").hover(function(){ var _flg = $(this).attr("data-flg"); clearTimeout(nav_slide_timer); $(".header-dropdown-items").stop(false,true).slideUp(200); $("header .nav-list ul li.nav-dropdown").removeClass("slided"); $(this).addClass("slided"); $(_flg).stop(false,true).slideDown(400); },function(){ nav_slide_timer = setTimeout(function(){ $("header .nav-list ul li.nav-dropdown").removeClass("slided"); $(".header-dropdown-items").stop(false,true).slideUp(200); },400); }); $(".header-dropdown-items").hover(function(){ clearTimeout(nav_slide_timer); },function(){ nav_slide_timer = setTimeout(function(){ $("header .nav-list ul li.nav-dropdown").removeClass("slided"); $(".header-dropdown-items").stop(false,true).slideUp(200); },400); }); $("header .nav-list ul li.dropdown").hover(function(){ $("header .nav-list ul li").removeClass("slided"); $(".header-dropdown-items").stop(false,true).slideUp(200); $("header .nav-list ul li.dropdown .item").stop(false,true); $(this).find(".item").slideDown(200); $(this).addClass("slided"); },function(){ $("header .nav-list ul li.dropdown .item").stop(false,true); $(this).find(".item").slideUp(200); $(this).removeClass("slided"); }); $("header .search").click(function(){ $("header").addClass("open"); }); $("header .top-search .wrap a.close").click(function(){ $("header").removeClass("open"); }); $("header a.mobileBtn").click(function(){ var index = $("header a.mobileBtn").index($(this)); if ($(this).attr("class") == "mobileBtn closed") { $(this).removeClass("closed"); $(".mobile_nav").removeClass("active"); $("body,html").removeClass("open") } else { $(this).addClass("closed"); $(".mobile_nav").addClass("active"); $("body,html").addClass("open") } }); $(".mobile_nav ul li i").click(function() { var index = $(".mobile_nav ul li i").index($(this)); if ($(this).attr("class") == "active") { $(this).removeClass("active"); $(this).next("ul").slideUp(); } else { $(".mobile_nav ul li i").removeClass("active"); $(".mobile_nav ul li ul").slideUp(); $(this).addClass("active"); $(this).next("ul").slideDown(); } }); $(".groupBody .map .item").hover(function(){ $(".groupBody .map .item .mask").stop(false,true); $(this).find(".mask").fadeIn(); },function(){ $(".groupBody .map .item .mask").stop(false,true); $(this).find(".mask").hide(); }); var unSelected = "#999"; var selected = "#333"; $("select").css("color", unSelected); $("option").css("color", selected); $(".prodselect").change(function() { var selItem = $(this).val(); if(selItem == $(this).find('option:first').val()) { $(this).css("color", unSelected); } else { $(this).css("color", selected); } }); $("header a.register,.mobile_nav .user a.register").click(function() { $(".popSign").fadeIn(); }); $("header a.login,.mobile_nav .user a.login").click(function() { $(".popLogin").fadeIn(); }); $(".popLogin a.lg_sign").click(function() { $(".popLogin").hide(); $(".popSign").fadeIn(); }); //2023-1-13 转移到common.js /*$(".popLogin a.lg_forgot").click(function() { $(".popLogin,.popForget .forget-2,.popForget .forget-3").hide(); $(".popForget .forget-1").show(); $(".popForget").fadeIn(); }); $(".popForget .forget-1 .next").click(function() { $(".popForget .forget-1").hide(); $(".popForget .forget-2").show(); }); $(".popForget .forget-2 .next").click(function() { $(".popForget .forget-2").hide(); $(".popForget .forget-3").show(); });*/ $(".popForget .forget-3 .box a.eyes").click(function() { var index = $(".popForget .forget-3 .box a.eyes").index($(this)); if ($(this).attr("class") == "eyes cur") { $(this).removeClass("cur"); $(this).prev("input").attr("type", "password"); } else { $(this).addClass("cur"); $(this).prev("input").attr("type", "text"); } }); // $(".popBody .popMask,.popBody a.popClose").click(function() { $(this).parents(".popBody").fadeOut(); }); $(".exist_body .exist_sign").click(function() { $(".popExist").hide(); $(".popSign").fadeIn(); }); $(".login_body .tab a").click(function(){ var index = $(".login_body .tab a").index($(this)); $(".login_body .tab a").removeClass("active").eq(index).addClass("active"); $(".login_body .tabcon .con").hide().eq(index).show(); }); $(".sign_body .right ul.list li .box a.eyes").click(function() { var index = $(".sign_body .right ul.list li .box a.eyes").index($(this)); if ($(this).attr("class") == "eyes cur") { $(this).removeClass("cur"); $(this).prev("input").attr("type", "password"); } else { $(this).addClass("cur"); $(this).prev("input").attr("type", "text"); } }); function top_ico_style() { var _top = $(this).scrollTop(); if (_top < 200){ $(".up_top_btn").removeClass("show"); } else if (_top > 200){ $(".up_top_btn").addClass("show"); } } $(window).scroll(function () { top_ico_style(); }); $(window).resize(function () { top_ico_style(); }); $(".up_top_btn").click(function () { $("html , body").animate({ "scrollTop": 0 }, 1000); }); $(".pop-footer .item .backtop").click(function() { $("html , body").animate({ "scrollTop": 0 }, 1000); }); $(".pop-footer .item .icon").click(function() { $(".pop-footer").find(".close-btn").removeClass("show"); $(".pop-footer").find(".pop-in").removeClass("show"); $(this).next(".close-btn").addClass("show"); $(this).parent(".item").find(".pop-in").addClass("show"); }); $(".pop-footer .item .close-btn").click(function() { $(this).removeClass("show"); $(this).next(".pop-in").removeClass("show"); }); if (!$.cookie('page-cookie')) { $( ",page-cookie" ).show(); $(".btn-decline").click(function() { $( ".page-cookie" ).slideDown(); // set the cookie for 24 hours var date = new Date(); date.setTime(date.getTime() + 24 * 60 * 60 * 1000); $.cookie('page-cookie', true, { expires: date }); }); } var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', mobile: true, live: true }); wow.init(); });