$(function() { $("div[i=h]").addclass("header-sunnavl-img"); var df = $("div[i=fn]"); df.addclass("footer-navclick").siblings().addclass("footer-navwords"); df.children("i").addclass("footer-navarr"); $(".header-searclick").click(function() { if ($(window).width() < 1000) { $(".header-navclick").removeclass("ontrue"); $(".header-navbarbox").slideup(140) } if ($(".header-searwords").is(":hidden")) { $(this).addclass("ontrue"); $(".header-searwords").slidedown(300) } else { $(this).removeclass("ontrue"); $(".header-searwords").slideup(100) } }); sunnavevent(); function sunnavevent() { if ($(window).width() > 1000) { $(".header-navbar").show(); $(".header-navbar ul li").hover(function() { $(this).find(".header-sunnav").fadein() }, function() { $(this).find(".header-sunnav").fadeout() }) } else { $(".header-sunnavclick").click(function() { var sunnavmobilewords = $(this).next(".header-sunnav"); $(".header-sunnav").slideup(200); $(".header-sunnavclick").removeclass("ontrue"); if ($(sunnavmobilewords).is(":hidden")) { $(this).addclass("ontrue"); $(sunnavmobilewords).slidedown(300) } else { $(this).removeclass("ontrue"); $(sunnavmobilewords).slideup(200) } }) } } $(".header-navclick").click(function() { if ($(window).width() < 1000) { $(".header-searwords").slideup(100); $(".header-searclick").removeclass("ontrue") } if ($(".header-navbarbox").is(":hidden")) { $(this).addclass("ontrue"); $(".header-navbarbox").slidedown(500) } else { $(this).removeclass("ontrue"); $(".header-navbarbox").slideup(300) } }); $(".footer-navarr").bind("click", function() { var fnavbarwords = $(this).parents(".footer-navclick").next(".footer-navwords"); $(".footer-navwords").slideup(300); $(".footer-navarr").removeclass("ontrue"); if ($(fnavbarwords).is(":hidden")) { $(this).addclass("ontrue"); $(fnavbarwords).slidedown(300) } else { $(this).removeclass("ontrue"); $(fnavbarwords).slideup(300) } }); $("a[href*=#],area[href*=#]").click(function() { if (location.pathname.replace(/^\//, "") == this.pathname.replace(/^\//, "") && location.hostname == this.hostname) { var $target = $(this.hash); $target = $target.length && $target || $("[name=" + this.hash.slice(1) + "]"); if ($target.length) { var targetoffset = $target.offset().top - $(".header-wrapper").height(); $("html,body").animate({ scrolltop: targetoffset }, 1000); return false } } }); $(".header-sunnavl-click a").mouseover(function() { var $ul2 = $(this).parents().siblings(".header-sunnavl-img"); var $this2 = $(this); var $t2 = $this2.index(); $ul2.removeclass("ontrue"); $ul2.eq($t2).addclass("ontrue") }); $(".backtop").hide(); $(window).scroll(function() { if ($(window).scrolltop() > 200) { $(".backtop").fadein(300) } else { $(".backtop").fadeout(200) } }); $(".backtop").click(function() { $("html,body").animate({ scrolltop: "0px" }, 800) }); }); $(".footop,#top").click(function () { $("body, html").stop().animate({ "scrolltop": 0 }); }); /* 寰俊鎻愮ず */ var btn=document.getelementbyid('btn'); var clipboard=new clipboard(btn); clipboard.on('success', function(e){ $('#weixin').slidedown().delay(1500).slideup(500); console.log(e); }); clipboard.on('error', function(e){ $('#weixin').slidedown().delay(1500).slideup(500); console.log(e); }); /* 寰俊寮圭獥 */ function dkcf(){$('#wxnr').fadein("fast");$('#fdwx').fadeout("fast");} function gbcf(){$('#fdwx').fadein("slow");$('#wxnr').fadeout("fast");}