$(function () { function rem() { var w = window.innerWidth; if (w > 640) { document.querySelector('html').style.fontSize = 100 + 'px'; } else { document.querySelector('html').style.fontSize = w / 320 * 50 + 'px'; } } rem(); $(window).on("resize", function () { rem(); }); $(".pc-search").on("click", function () { if (!$(".header").hasClass('searchopen')) { $(".header").addClass('searchshow') $(".navbar").on("animationend webkitAnimationEnd", function () { $(".header").removeClass('searchshow').addClass('searchopen') }) } else { $(".header").removeClass('searchopen') } $(".mask").toggle() }); $(".search-pclose").on("click", function () { $(".header").removeClass('searchopen') $(".mask").hide() }); /*! http://mths.be/placeholder v2.0.8 */ ! function (a) { "function" == typeof define && define.amd ? define(["jquery"], a) : a("object" == typeof module && module.exports ? require("jquery") : jQuery) }(function (a) { function b(b) { var c = {}, d = /^jQuery\d+$/; return a.each(b.attributes, function (a, b) { b.specified && !d.test(b.name) && (c[b.name] = b.value) }), c } function c(b, c) { var d = this, f = a(this); if (d.value === f.attr(h ? "placeholder-x" : "placeholder") && f.hasClass(n.customClass)) if (d.value = "", f.removeClass(n.customClass), f.data("placeholder-password")) { if (f = f.hide().nextAll('input[type="password"]:first').show().attr("id", f.removeAttr("id").data("placeholder-id")), b === !0) return f[0].value = c, c; f.focus() } else d == e() && d.select() } function d(d) { var e, f = this, g = a(this), i = f.id; if (!d || "blur" !== d.type || !g.hasClass(n.customClass)) if ("" === f.value) { if ("password" === f.type) { if (!g.data("placeholder-textinput")) { try { e = g.clone().prop({ type: "text" }) } catch (j) { e = a("").attr(a.extend(b(this), { type: "text" })) } e.removeAttr("name").data({ "placeholder-enabled": !0, "placeholder-password": g, "placeholder-id": i }).bind("focus.placeholder", c), g.data({ "placeholder-textinput": e, "placeholder-id": i }).before(e) } f.value = "", g = g.removeAttr("id").hide().prevAll('input[type="text"]:first').attr("id", g.data("placeholder-id")).show() } else { var k = g.data("placeholder-password"); k && (k[0].value = "", g.attr("id", g.data("placeholder-id")).show().nextAll('input[type="password"]:last').hide().removeAttr("id")) } g.addClass(n.customClass), g[0].value = g.attr(h ? "placeholder-x" : "placeholder") } else g.removeClass(n.customClass) } function e() { try { return document.activeElement } catch (a) { } } var f, g, h = !1, i = "[object OperaMini]" === Object.prototype.toString.call(window.operamini), j = "placeholder" in document.createElement("input") && !i && !h, k = "placeholder" in document.createElement("textarea") && !i && !h, l = a.valHooks, m = a.propHooks, n = {}; j && k ? (g = a.fn.placeholder = function () { return this }, g.input = !0, g.textarea = !0) : (g = a.fn.placeholder = function (b) { var e = { customClass: "placeholder" }; return n = a.extend({}, e, b), this.filter((j ? "textarea" : ":input") + "[" + (h ? "placeholder-x" : "placeholder") + "]").not("." + n.customClass).not(":radio, :checkbox, [type=hidden]").bind({ "focus.placeholder": c, "blur.placeholder": d }).data("placeholder-enabled", !0).trigger("blur.placeholder") }, g.input = j, g.textarea = k, f = { get: function (b) { var c = a(b), d = c.data("placeholder-password"); return d ? d[0].value : c.data("placeholder-enabled") && c.hasClass(n.customClass) ? "" : b.value }, set: function (b, f) { var g, h, i = a(b); return "" !== f && (g = i.data("placeholder-textinput"), h = i.data("placeholder-password"), g ? (c.call(g[0], !0, f) || (b.value = f), g[0].value = f) : h && (c.call(b, !0, f) || (h[0].value = f), b.value = f)), i.data("placeholder-enabled") ? ("" === f ? (b.value = f, b != e() && d.call(b)) : (i.hasClass(n.customClass) && c.call(b), b.value = f), i) : (b.value = f, i) } }, j || (l.input = f, m.value = f), k || (l.textarea = f, m.value = f), a(function () { a(document).delegate("form", "submit.placeholder", function () { var b = a("." + n.customClass, this).each(function () { c.call(this, !0, "") }); setTimeout(function () { b.each(d) }, 10) }) }), a(window).bind("beforeunload.placeholder", function () { var b = !0; try { "javascript:void(0)" === document.activeElement.toString() && (b = !1) } catch (c) { } b && a("." + n.customClass).each(function () { this.value = "" }) })) }); //header $(window).scroll(function () { var h = $(window).height(); var sc = $(window).scrollTop(); if (sc > 0) { $(".header").addClass('black') } else { $(".header").removeClass('black') } }); //app-header var Accordion = function (el, multiple) { this.el = el || {}; this.multiple = multiple || false; var links = this.el.find('.P_tig'); links.on('click', { el: this.el, multiple: this.multiple }, this.dropdown) } Accordion.prototype.dropdown = function (e) { var $el = e.data.el; $this = $(this), $next = $this.parents('.P_parent').find(".P_slide"); $next.slideToggle(); $this.parents('.P_parent').toggleClass('open'); if (!e.data.multiple) { $el.find('.P_slide').not($next).slideUp().parent().removeClass('open'); }; } var accordion_header = new Accordion($('.nav-list'), false); var navHear = $(".header-app"); $(".navbar-togger").on("click", function () { var open = navHear.hasClass("open-menu"); if (open) { navHear.removeClass("open-menu"); $(".navbar-togger").removeClass('on') $('.nav-menu').hide(); } else { navHear.addClass("open-menu"); $('.nav-menu').show(); } }); //footer var accordion_footer = new Accordion($('.footer-menu'), false); // video var accordion_video = new Accordion($('.pro-menu2'), false); //pc产品二级导航 var Accordion = function (el, multiple) { this.el = el || {}; this.multiple = multiple || false; var links = this.el.find('.pro-item1'); links.on('click', { el: this.el, multiple: this.multiple }, this.dropdown) } Accordion.prototype.dropdown = function (e) { var $el = e.data.el; $this = $(this), $next = $this.parents('.pro-parent1').find(".pro-slide1"); $next.slideToggle(); $this.parents('.pro-parent1').toggleClass('open'); if (!e.data.multiple) { $el.find('.P_slide').not($next).slideUp().parent().removeClass('open'); }; } var accordion_pro = new Accordion($('.pro-menu'), false); //appsecond-nav $(".appsecond-nav").on("click", ".serapp-top1", function () { $(this).siblings(".ser-bot").slideToggle(300); $(this).closest(".appsecond-nav").toggleClass("open"); }); $(".se-top").click(function () { $(this).next('.se-bot').slideToggle(); $(this).parents('.seb-list').siblings('.seb-list').find('.se-bot').slideUp(); //$(this).find('.P_tig').addClass('open') var tig = $(this).find('.P_tig'); if (tig.hasClass('open')) { $(this).find('.P_tig').removeClass('open') $(this).next('.se-bot').slideUp(); } else { $(this).find('.P_tig').addClass('open'); $(this).next('.se-bot').slideDown(); $(this).parents('.seb-list').siblings('.seb-list').find('.P_tig').removeClass('open');; } }) $(function () { $(".menu1").click(function () { var span = $(this).find("span"); if (span.hasClass("open1")) { span.removeClass("open1").addClass("close1"); $(".btnss").removeClass("open1").addClass("close1"); $(this).find(".icon_menu").addClass("icon_menu2"); } else { span.removeClass("close1").addClass("open1"); $(".btnss").removeClass("close1").addClass("open1"); $(this).find(".icon_menu").removeClass("icon_menu2"); } }); }); $('.app-sousuo').click(function () { $('.alert-search').fadeIn() $('body').css({ 'position': 'fixed', "width": "100%", "height": "100%" }); }) $('.search-close').click(function () { $('.alert-search').fadeOut() $("body").css({ "position": "initial", "height": "auto" }); }) $(".kf-top").click(function () { $("html,body").animate({ "scrollTop": 0 }, 1000); }); $("a.shangqiao").click(function () { if ($('#nb_invite_ok').length > 0) { $('#nb_invite_ok').click(); } else { $('#nb_invite_ok').click(); } }); // kf $(".kf span").hover(function () { $(this).find("div").show(); }, function () { $(this).find("div").hide(); }); $(".kf span div").hover(function () { $(this).show(); }, function () { $(this).hide(); }); $(".kf .back_top").click(function () { $("html,body").animate({ "scrollTop": 0 }, 1000); }); var i = 0; $(".shou").click("fast", function () { i++; if (i % 2 == 0) { $(this).removeClass('on'); $(".kf").css({ "right": "20px" }); } else { $(this).addClass('on'); $(".kf").css({ "right": "-67px" }); } $(".zhan").click(function () { $(this).delay(10000).stop().fadeOut(); $(".kf").css({ "right": "30px" }); $(".shou").css({ "right": "92px" }); }); }); // kf $(".kf-shqi").on("click", function () { $('.kf').toggleClass("show"); if ($('.kf').hasClass("show")) { $('.kf').find("span").fadeIn() } else { $('.kf').find("span").fadeOut() } }); //鏀惰捣瀹㈡湇 var i = 0; $(".shou").click("fast", function () { i++; if (i % 2 == 0) { $(this).removeClass('on'); $(".kf").css({ "right": "20px" }); } else { $(this).addClass('on'); $(".kf").css({ "right": "-67px" }); } //灞曞紑瀹㈡湇 $(".zhan").click(function () { $(this).delay(10000).stop().fadeOut(); $(".kf").css({ "right": "30px" }); $(".shou").css({ "right": "92px" }); }); }); $(window).scroll(function () { var h = $(window).height(); var sc = $(window).scrollTop(); //瀹㈡湇鏄剧ず if (sc > 500) { $(".kf").show(); } else { $(".kf").hide(); } if (sc > 0) { $(".top2").addClass('on'); $(".header-app").addClass('on'); } else { $(".top2").removeClass('on'); $(".header-app").removeClass('on'); } }); // 动画 let landInTexts = document.querySelectorAll(".landIn"); landInTexts.forEach(landInText => { let letters = landInText.textContent.split(""); landInText.textContent = ""; letters.forEach((letter, i) => { let span = document.createElement("span"); //创建span标签 span.setAttribute('class', 'kongs'); //给标签添加类名 span.textContent = letter; span.style.animationDelay = `${i * 0.086}s`; landInText.append(span); }); }); $(".form-ul .li input").focus(function(){ $(this).parents(".li").removeClass("on"); }).blur(function(){ $(this).parents(".li").addClass("on"); }); $('#video').click(function() { var SRC SRC = $(this).attr('src'); console.log(SRC) // 停止当前的动画,并移除其余的动画队列 $('#msg-box-bg').stop(true, false).fadeIn() $('#msg-box-bg .msg-box').stop(true, false).animate({// 从上滑出的效果 'top': '50%', }, 800) $("#vedios").attr('src', SRC) // $('body').css({ 'overflow': 'hidden' });//弹框后禁止浏览器滚动 }); $('#close-box').click(function() { $('#msg-box-bg').stop(true, false).fadeOut() $('#msg-box-bg .msg-box').stop(true, false).animate({ 'top': '-50%', }, 300) $("#vedios").attr('src', '') // $('body').css({ 'overflow': 'auto' }); }); $(".nav-yu a").hover(function(){ $(this).addClass("on").siblings("a").removeClass("on") }); // css动画 $(function () { var isIE = function (ver) { ver = ver || ''; var b = document.createElement('b'); b.innerHTML = ''; return b.innerHTML === '1' }; if (isIE(8) || isIE(7)) { } else { // 动画 wow = new WOW({ animateClass: 'animated' }); wow.init(); } }); // 锚点 $(function () { $("a").click(function () { var w = $(window).width(); var href = $(this).attr("href"); var index = href.indexOf('#'); var id = href.substr(index) $("html, body").animate({ scrollTop: $(id).offset().top -$(".header").height() + "px" }, 500); }); $(".foot_nav dd a").click(function () { var w = $(window).width(); var href = $(this).attr("href"); var index = href.indexOf('#'); var id = href.substr(index) $("html, body").animate({ scrollTop: $(id).offset().top -$(".header").height() + "px" }, 500); }); $(".category-cont a").click(function () { var href = $(this).attr("href"); var index = href.indexOf('#'); var id = href.substr(index) $("html, body").animate({ scrollTop: $(id).offset().top -$(".navbar-app").height() + "px" }, 500); }); $(".footer-cont a").click(function () { var href = $(this).attr("href"); var index = href.indexOf('#'); var id = href.substr(index) $("html, body").animate({ scrollTop: $(id).offset().top -$(".navbar-app").height() + "px" }, 500); }); }); })