$('.lanGuage').click(function(){ $(this).find('ul').slideToggle(); }) $('.navLi').mouseover(function(){ var navH=$('.navLi:hover .listDiv').height(); var headH=$('.header').height(); $('.threeNavBg').css({ "top":navH+headH }); }); $('.header_box .header_main .header_menu').click(function() { $(this).toggleClass('act'); $('.mob_header').slideToggle(); }) $('.mob_header .bob_nav .nav_item > a').click(function() { $(this).toggleClass('act'); $(this).next().slideToggle(); }); $('.mob_header .bob_nav .nav_item .nav_select_ .select_item > a').click(function() { $(this).toggleClass('act'); $(this).next().slideToggle(); }); $('.mob_header .bob_nav .nav_item .nav_titlt').click(function(){ $(this).toggleClass('act'); $(this).next().slideToggle(); }); $(window).scroll(function() { var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; if (scrollTop >= 95) { $('.headers').addClass('header-fix'); } else { $('.headers').removeClass('header-fix'); } }); $('.search-btn a').on('click',function () { $('.search').stop().slideToggle(300); }); $('.search .close').click(function () { $('.search').hide(); }); $('.nav li').hover(function () { $(this).addClass('open'); }, function () { $(this).removeClass('open'); }); var arrNew=[]; $('.nav .listDiv .list-li.list-lii').mouseover(function(){ $('.nav .listDiv .list-li').each(function(){ arrNew.push($(this).find('.threeNav').height()); }) let maxNum=Math.max(...arrNew) $('.threeNavBg').css({ "height":maxNum+20 }); $('.threeNavBg').show(); }).mouseleave(function(){ $('.threeNavBg').hide(); }) // DOM加载 $(function(){ // 移动端导航条 mblNav_but(); // tab切换 function tab(tab_list,tab_div,tab_on){ $(tab_list).on(tab_on,function(){ $(this).addClass('active').siblings().removeClass('active'); $(tab_div).eq($(this).index()).addClass('vis').siblings().removeClass('vis'); }) } tab("","","click"); $(".pgImgDiv-body").each(function(){ var _this = $(this); var _thisDiv = _this.children(".div"); _thisDiv.attr({ "data-height": _thisDiv.outerHeight() }) }) window_width(); }) $(window).resize(function(){ window_width(); }) function window_width(){ if($(window).width()>1000){ $(".pgImgDiv").mouseover(function(){ var _thisParent = $(this).find('.pgImgDiv-head'); var _thisBody = _thisParent.siblings(".pgImgDiv-body"); _thisParent.addClass("active"); _thisBody.css('height', _thisBody.children(".div").data("height")) }).mouseleave(function(){ var _thisParent = $(this).find('.pgImgDiv-head'); var _thisBody = _thisParent.siblings(".pgImgDiv-body"); _thisParent.removeClass("active"); _thisBody.css('height', "0") }) }else{ $(".pgImgDiv-head .iconfont").click(function(){ var _thisParent = $(this).parent(); var _thisBody = _thisParent.siblings(".pgImgDiv-body"); if (!_thisParent.hasClass("active")) { _thisParent.addClass("active"); _thisBody.css('height', _thisBody.children(".div").data("height")) }else{ _thisParent.removeClass("active"); _thisBody.css('height', "0") } }) $(".gyShangBox").click(function(){ $(this).children(".ewm").fadeToggle(); }) } } // 页面滚动 $(window).scroll(function(){ var hHeight = $(window).height(); let top = $(window).scrollTop(); // var boxtop = $("").offset().top; if(top>50){ // $('.nav .listDiv').css({ // visibility: "hidden", // opacity: 0 // }) }else{ // $('.nav .listDiv').css({ // visibility: "visible", // opacity: 1 // }) } }); //表单输入 function form_label(){ $(".inp").on("input", function() { var v = $(this).find('textarea'); var vN = $(this).find('textarea').val(); v.focus(function(){ v.siblings('label').css("display", "none"); }); v.blur(function(){ if (vN == null ||vN == "") { v.siblings('label').css("display", "block"); } else { v.siblings('label').css("display", "none"); } }); }).trigger("input"); $(".inp").on("input", function() { var v = $(this).find('input'); var vN = $(this).find('input').val(); v.focus(function(){ v.siblings('label').css("display", "none"); }); v.blur(function(){ if (vN == null ||vN == "") { v.siblings('label').css("display", "block"); } else { v.siblings('label').css("display", "none"); } }); }).trigger("input"); $(".inp textarea").each(function() { var vN = $(this).val(); if (vN == null ||vN == "") { $(this).siblings('label').css("display", "block"); } else { $(this).siblings('label').css("display", "none"); } }); $(".inp input").each(function() { var vN = $(this).val(); if (vN == null ||vN == "") { $(this).siblings('label').css("display", "block"); } else { $(this).siblings('label').css("display", "none"); } }) } // 单选选中按钮样式 function inp_radio(){ $(".inp_radio").each(function(){ var _this = $(this); if(_this.is(":checked")){ _this.parent('.fmbut_radio').addClass("active"); }else{ _this.parent('.fmbut_radio').removeClass("active"); } }) $(".inp_radio").click(function(){ $(".inp_radio").each(function(){ var _this = $(this); if(_this.is(":checked")){ _this.parent('.fmbut_radio').addClass("active"); }else{ _this.parent('.fmbut_radio').removeClass("active"); } }) }) } // 复选选中按钮样式 function inp_checkbox(){ $(".inp_checkbox").each(function(){ var _this = $(this); if(_this.is(":checked")){ _this.parent('.fmbut_checkbox').addClass("active"); }else{ _this.parent('.fmbut_checkbox').removeClass("active"); } }) $(".inp_checkbox").click(function(){ $(".inp_checkbox").each(function(){ var _this = $(this); if(_this.is(":checked")){ _this.parent('.fmbut_checkbox').addClass("active"); }else{ _this.parent('.fmbut_checkbox').removeClass("active"); } }) }) } // 首页导航搜索 function hm_seach(){ $(".seach").mouseenter(function(){ $(this).find(".seachinp").addClass("vis"); }).mouseleave(function(){ var findinp = $(this).find(".seachinp input").val(); if(findinp==""||findinp=="null"){ $(this).find(".seachinp").removeClass("vis"); } }) } //导航按钮 function nav_but(){ $('.navToggle').click(function () { if($(".nav").is(":hidden")){ $(this).addClass("active"); $(".nav").slideDown(); }else{ $(this).removeClass("active"); $(".nav").slideUp(); } }); } // banner 视频 function ban_video(){ var changeHeight=$(window).height() var changeWidth=$(window).width(); $(".ban_video").height(changeHeight); if(changeHeight/changeWidth<0.416){ $(".ban_video").css({"width":changeWidth,"height":changeWidth*0.416}); }else if(changeHeight/changeWidth>0.416){ $(".ban_video").css({"width":changeHeight/0.416,"height":changeHeight}); } } // 返回顶部 function initScrollToTop(){ $("html,body").animate({scrollTop: 0},1000); } // 锚点平滑跳转 function a_mao(){ $('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; $('html,body').animate({ scrollTop: targetOffset }, 1000); return false; } } }); } //触发弹窗底部页面禁止滑动 function fixed(){ var scrollTop = $(window).scrollTop(); $('#bodyBox').attr('data-top',scrollTop); var contentStyle = document.getElementById("bodyBox").style;//content是可以滚动的背景元素id名称 contentStyle.position = 'fixed'; //contentStyle是第二步的变量,设置背景元素的position属性为‘fixed' contentStyle.top = "-"+scrollTop+"px"; } //关闭弹窗底部页面恢复滑动 function fixed_cancel(){ var contentStyle = document.getElementById("bodyBox").style; var scrollTop = $('#bodyBox').attr('data-top');//设置背景元素的位置 contentStyle.top = '0px';//恢复背景元素的初始位置 contentStyle.position ="static";//恢复背景元素的position属性(初始值为absolute,就恢复为absolute,以此类推) $(document).scrollTop(scrollTop);//scrollTop,设置滚动条的位置 } // 滚动条 function fun_scroll(){ $(".party_pcont").mCustomScrollbar({ theme: "dark-thin", advanced: { autoExpandHorizontalScroll: true } }); } /* 移动端导航条 */ function mblNav_but(){ //点击逐渐展开移动端导航 $(".m_img").click( function() { $(".m_nav").stop(true, false).delay(0).animate({ width: "100%", height: "100%" }, 0); $(".m_nav").find(".closecover").stop(true, false).delay(0).animate({ opacity: "0.5" }, 300); $(".m_nav").find(".closeicon").stop(true, false).delay(0).animate({ opacity: "1" }, 300); $(".m_nav").find(".m_navList").stop(true, false).delay(0).animate({ top: "0" }, 300); $('body').css('overflow', 'hidden'); } ) //点击关闭,逐渐隐藏 $(".a_closed").click( function() { $(".m_nav").stop(true, false).delay(300).animate({ width: "0", height: "0" }, 0); $(".m_nav").find(".closecover").stop(true, false).delay(0).animate({ opacity: "0" }, 300); $(".m_nav").find(".closeicon").stop(true, false).delay(0).animate({ opacity: "0" }, 300); $(".m_nav").find(".m_navList").stop(true, false).delay(0).animate({ top: "-100%" }, 300); $('body').css('overflow', 'auto'); } ) $(".m_s_nav a").click(function(){ $(".m_nav").stop(true, false).delay(300).animate({ width: "0", height: "0" }, 0); $(".m_nav").find(".closecover").stop(true, false).delay(0).animate({ opacity: "0" }, 300); $(".m_nav").find(".closeicon").stop(true, false).delay(0).animate({ opacity: "0" }, 300); $(".m_nav").find(".m_navList").stop(true, false).delay(0).animate({ top: "-100%" }, 300); $('body').css('overflow', 'auto'); }) //判断是否有子标题 $('.m_navList ul li').each(function() { $(this).children('.m_f_a').find('i').addClass('icon') if ($(this).children('.m_s_nav').find('a').length < 1) { $(this).children('.m_f_a').children('i').removeClass('icon'); } }); //点击图标展开关闭子导航 $('.m_navList ul li').find('.m_f_a i').click(function() { $(this).parent().parent().siblings().children('.m_s_nav').slideUp(); $(this).parent().parent().siblings().children('.m_f_a').find('i').removeClass('icon_on') $(this).parent().next().toggle("normal").prev().children('i').toggleClass('icon_on'); }) } // 禁止页面操作 // 屏蔽右键 function un_rtbutton(){ document.oncontextmenu = function (event){ if(window.event){ event = window.event; } try{ var the = event.srcElement; if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){ return false; } return true; } catch (e){ return false; } } } // 屏蔽选中 function un_select(){ document.onselectstart = function (event){ if(window.event){ event = window.event; } try{ var the = event.srcElement; if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){ return false; } return true; } catch (e) { return false; } } } // 屏蔽复制 function un_copy(){ document.oncopy = function (event){ if(window.event){ event = window.event; } try{ var the = event.srcElement; if(!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){ return false; } return true; } catch (e){ return false; } } } // 屏蔽剪切 function un_shear(){ document.oncut = function (event){ if(window.event){ event = window.event; } try{ var the = event.srcElement; if(!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){ return false; } return true; } catch (e){ return false; } } } // 屏蔽粘贴 function un_paste(){ document.onpaste = function (event){ if(window.event){ event = window.event; } try{ var the = event.srcElement; if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){ return false; } return true; } catch (e){ return false; } } } rotate(); // ipad 禁止横屏 function rotate() { var orientation = window.orientation; var pd = null; function createPd() { if (document.getElementById('preventTran') === null) { var imgData = 'data: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2T+tlHrAiw+eCRuGsQcRbwOAo1xGK4T4VSaTeXFoaOiUF2A/slJKTpHkVMnJRkRPmqY5VdbrxqYfwuX2z1kA4Az0P/DzMgCwzzTN424c8CIjpdxd/MCC4zjbLMt6wosNz4R1Xb9ZCMHbydkaX+TxmzpcZ/xjpRSXzwdqfX19S3K5HG8ACrf5IIRYOzg4+KoXw54Jc+HysWPHuH74EpdA25VSW13Kziim6zqXy3OEC20slUq1eX2mxjNhRpNSmlxR64LEHk3THojFYjzkAzUp5e8AoLjs/kdKqQe9GvVLmNON+cGS2dpzjuNsmmnX4sVRXdc7hBA7i3R4hfiYUur3XuywrC/C/CBBOBzm93RC5QCJ6MWxsbGNe/fu9fxhUGovGo1e3tDQcAQRLy78jYieNU2z+EkN17x9Ec4P6xcAgJenaY2IDk5MTNyVTCYnXHsxgyB3bCgUehkRbywim7Ft+4ZEIvGWH/u+Ceu6/pAQ4ntlQF87ffr03UFL5Xt7ey+1bXsfP4ZSjOE4zqOWZfH7A76ab8JdXV1XhUKht2cY0qOO48gdO3bs9+OVYRh3AkAcES8r0edSHM7e5yMcX8034fyw/jMAXAMAXFNYehTETvFE83Wl1F/ceNfd3X2dEOJr+Sdqpj1CRkSHJyYmbg/6UwlE2DAMPuyLZLPZezVNiyFi6ZtazJOJ8+0F54Mdymazbx0/fnwyU2758uWtoVDoI7Ztr+WTRSJaW67eiSfBTCazeefOne+56bjZZAIRzhtmG8Q7mba2tu8AwBcrWKTFnfX4yMjIowcOHMgFJcv6lSA8zQ8p5a0AwJPZqiAOEtEb/AigZVkHg9gp1a04YQaIRCINzc3N9yHil4honYeIF4b/9/Pf374np5k6aU4IF4NJKT8EAO355E5+NelyACjcBvJ7WKMAwLusV3K53L5EIsH/nrP2PzAJNfmP9znfAAAAAElFTkSuQmCC'; pd = document.createElement('div'); pd.setAttribute('id', 'preventTran'); pd.style.position = 'fixed'; pd.style.left = '0'; pd.style.top = '0'; pd.style.width = '100%'; pd.style.height = '100%'; pd.style.overflow = 'hidden'; pd.style.backgroundColor = '#2e2e2e'; pd.style.textAlign = 'center'; pd.style.zIndex = '99999'; document.getElementsByTagName('body')[0].appendChild(pd); var img = document.createElement('img'); img.src = imgData; pd.appendChild(img); img.style.margin = '60px auto 30px' var br = document.createElement('br'); var p = document.createElement('p'); p.style.width = '100%'; p.style.height = 'auto'; p.style.fontSize = '22px'; p.style.color = '#626262'; p.style.lineHeight = '34px'; p.style.textAlign = 'center'; p.innerHTML = '为了您的良好体验'; p.appendChild(br); p.innerHTML += '请将手机/平板竖屏操作'; pd.appendChild(p); } } if (orientation == 90 || orientation == -90) { if (pd == null && document.getElementById('preventTran') === null) createPd(); document.getElementById('preventTran').style.display = 'block'; } window.onorientationchange = function() { if (pd == null && document.getElementById('preventTran') == null) createPd(); document.getElementById('preventTran').style.display = 'none'; rotate(); }; };