$(function () { wowInt(); findTel(); phoneTargetSelf(); banner(); nav(); search(); sideBar(); IndPart01(); IndPart03(); public_ajax(); share(); if($(window).width()>767){ ScollText(".team_re"); ScollText(".team_scoll"); } if($("#erji").length>0){ $(".pub_tab li a span").each(function(){ if($(this).html()==$("#erji").html()){ $(this).parents("li").addClass("on"); return; } }) } //wowDelay(".index-part02 ul",$('.index-part02 ul li').length,"0.2"); //椤堕儴鎮诞 $(window).scroll(function(){ if($(window).scrollTop()>0){ $("body").addClass("scroll-header"); }else{ $("body").removeClass("scroll-header"); } }) //搴曢儴 if($(window).width()<767){ $(".foot_top li h2").click(function(){ $(this).parent("li").siblings().removeClass("on"); $(this).parent("li").siblings().find(".con").slideUp(); $(this).parent("li").toggleClass("on"); $(this).parent("li").find(".con").slideToggle(); }) } $(document).on("click",".site_btn i",function(){ $(".sidebar").addClass("cur"); }) $(document).on("click",".site_btn span",function(){ $(".sidebar").removeClass("cur"); }) $(".tel_a").click(function(){ console.log('1') }) //鍏叡閫夐」鍗 $(".commtab-box .commtab-a").each(function() { $(this).click(function() { if (!$(this).hasClass("off")) { $(this).addClass("on").siblings().removeClass("on"); var ii=$(this).index(); $(this).parents(".commtab-box").find(".commtab-b").eq(ii).show().siblings().hide(); } }); }) $(".commtab-box").each(function (i) { $(this).find(".commtab-a:eq(0)").click(); }); //鍊掕鏃?0s var countdown = 60; $('.count button').on('click',function(){ var obj = $(".count button"); settime(obj); }) function settime(obj) { if (countdown == 0) { $('.count button').text('鑾峰彇楠岃瘉鐮?).removeAttr('disabled'); $(".count button").removeAttr("style"); countdown = 60; return; } else { $('.count button').attr('disabled', true); $('.count button').text("("+ countdown +"s)"); countdown--; } setTimeout(function () { settime(obj) } , 1000) } //浜у搧鍒囨崲 var _ind = 0; var _len = $(".pro_tit li").length; $(".pro_tit li").click(function(){ var url = $(this).data("src"); $(this).addClass("on").siblings().removeClass("on"); caseAjax(".pro_con",url); }) $(".pro_tit li:eq(0)").click(); var _ind = GetQueryString("index"); if(_ind){ $(".pro_tit li:eq(" + _ind + ")").click(); }else{ $(".pro_tit li:eq(0)").click(); } //浜у搧鍒囨崲 }) function banner(){ //棣栭〉banner鍙互甯﹁棰戞晥鏋 $(window).resize(); var mySwiper = new Swiper('.banner .swiper-container',{ pagination : '.banner .swiper-pagination', paginationClickable: true, //prevButton:'.banner .swiper-button-prev', //nextButton:'.banner .swiper-button-next', autoplay:5000, speed:1000, loop: false, autoplayDisableOnInteraction : false, onInit: function(swiper){ swiperAnimateCache(swiper); swiperAnimate(swiper); }, onSlideChangeEnd: function(swiper){ swiperAnimate(swiper); var _this = $('.banner .swiper-slide').eq(swiper.activeIndex); //if($(window).width()>767){ videoSelect(_this); //} } }) if($("html").hasClass("lt10")){ var test2 = setInterval(function () { mySwiper.slideNext(); }, 10000); $(".banner").hover(function(){ clearInterval(test2); },function(){ test2 = setInterval(function () { mySwiper.slideNext(); }, 5000); }) } var len = $('.banner .swiper-slide').length if(len <= 1){ console.log('灏变竴涓?) $('.banner .swiper-pagination').hide() } $(window).resize(function () { var len = $('.banner .swiper-slide').length if(len <= 1){ console.log('灏变竴涓?) $('.banner .swiper-pagination').hide() } }); console.log(len) //if($(window).width()>767){ videoSelect($('.banner .swiper-slide.swiper-slide-active')); //} function videoSelect(_this){ var flag = true; var cc = _this.hasClass('ban_video'); if(cc){ mySwiper.stopAutoplay(); var videos = ''; if($(window).width()<=767){ var videos = ''; } _this.append(videos); var aaa = setInterval(function(){ if(!isNaN($(".vv").get(0).duration)&&flag){ clearInterval(aaa); flag=false; setTimeout(function(){ _this.find('video').css("display","block"); },500) } },10); _this.find('video').bind('ended',function () { mySwiper.slideNext(); mySwiper.startAutoplay(); }); }else{ $('.vv').remove(); } } //棣栭〉banner end } //涓诲鑸 function nav(){ if ($(window).width()>1024) { $('.nav li').hover(function(){ $(".nav_list").addClass("show"); $(".nav_list .li_01").eq($(this).index()).addClass("on").siblings().removeClass("on"); },function(){ $(".nav_list").removeClass("show"); }) $(".nav_list").hover(function(){ $(".nav_list").addClass("show"); },function(){ $(".nav_list").removeClass("show"); }) $(document).on("click",".nav_close",function(){ //$(".nav_list").stop().slideUp(); $(".nav_list").removeClass("show"); $(".nav_list .li_01").removeClass("on"); }) $('.li_01>h3').hover(function(){ $(this).parent(".li_01").addClass("on"); $(this).parent(".li_01").siblings().removeClass("on"); $(this).siblings().find(".li_02").removeClass("on"); if($(window).width()>1024){ $(this).siblings().find(".li_02").eq(0).addClass("on"); }else{ } },function(){ }) $('.li_01 .li_02 h3').hover(function(){ $(this).parent(".li_02").addClass("on"); $(this).parent(".li_02").siblings().removeClass("on"); if($(window).width()>1024){ $(this).siblings(".nav_block").show(); $(this).parent(".li_02").siblings().find(".nav_block").hide(); }else{ } },function(){ }) } else{ $(document).on("click",".nav_phone_btn",function(){ $(this).toggleClass("visible_nav"); $("body").toggleClass("navbody"); $(".nav_list .li_01").removeClass("on"); $(".nav_list .li_02").removeClass("on"); }) $(document).on("click",".nav li",function(){ $("body").addClass("navbody"); $(".nav_phone_btn").addClass("visible_nav"); $(".nav_list .li_01").eq($(this).index()).addClass("on").siblings().removeClass("on"); }) $(document).on("click",".li_01>h3",function(){ $(this).parent(".li_01").addClass("on"); $(this).parent(".li_01").siblings().removeClass("on"); $(this).siblings().find(".li_02").removeClass("on"); if($(window).width()>1024){ $(this).siblings().find(".li_02").eq(0).addClass("on"); }else{ } }) $(".nav_list .li_01 .li_02 h3 a").find("span").remove(); $(".nav_list .li_01 .li_02 h3 a").after(""); $(document).on("click",".li_01 .li_02 h3>span",function(){ console.log(1) $(this).parents(".li_02").addClass("on"); $(this).parents(".li_02").siblings().removeClass("on"); if($(window).width()>1024){ $(this).siblings(".nav_block").show(); $(this).parents(".li_02").siblings().find(".nav_block").hide(); }else{ } }) $(document).on("click",".li_01>.nav_block>.return_a",function(){ $(".li_01").removeClass("on"); }) $(document).on("click",".li_02 .nav_block .return_a",function(){ $(".li_02").removeClass("on"); }) } } //鍏叡鍙充晶杈规爮 function sideBar(){ /*$(window).scroll(function(){ if($(this).scrollTop() >= 200){ $('.sidebar').fadeIn(); }else{ $('.sidebar').fadeOut(); } })*/ $('.sidebar li.toTop').click(function(e){ e.stopPropagation(); var top = $('html,body').scrollTop(); $('html,body').animate({"scrollTop":"0px"}); }) } //鎼滅储 function search(){ $(".head_rr a.a_ser").click(function (e) { e.preventDefault(); e.stopPropagation(); $(this).toggleClass("on"); //$(".search_wrap").slideToggle(200); $(".search_wrap").toggleClass("on"); }) $(".search_box_text").click(function (e) { e.preventDefault(); e.stopPropagation(); }) $(document).click(function(){ //$(".search_wrap").slideUp(200); $(".search_wrap").removeClass("on"); $(".a_ser").removeClass("on"); }) } function ScollText(obj){ if($(obj).length>0){ $(obj).mCustomScrollbar({ mouseWheelPixels:500, autoDraggerLength:false, advanced: { autoScrollOnFocus: "" } }); } } function IndPart01(){ var indp01Swiper = new Swiper('.index-part01 .swiper-container',{ slidesPerView : 4, spaceBetween : 15, prevButton:'.index-part01 .swiper-button-prev', nextButton:'.index-part01 .swiper-button-next', breakpoints: { 1023: { slidesPerView: 2, spaceBetween: 10 }, 480: { slidesPerView: 1, spaceBetween: 5 } } }) if($(window).width()<=767){ if($(".index-part01 li").size()<=1){ $(".index-part01 .swiper-button-prev,.index-part01 .swiper-button-next").hide(); } } else if($(window).width()>1023){ if($(".index-part01 li").size()<=4){ $(".index-part01 .swiper-button-prev,.index-part01 .swiper-button-next").hide(); } } else if(767<$(window).width()<=1023){ if($(".index-part01 li").size()<=2){ $(".index-part01 .swiper-button-prev,.index-part01 .swiper-button-next").hide(); } } } function IndPart03(){ var indp03Swiper = new Swiper('.index-part03 .swiper-container',{ slidesPerView : 3, spaceBetween : 35, prevButton:'.index-part03 .swiper-button-prev', nextButton:'.index-part03 .swiper-button-next', breakpoints: { 1023: { slidesPerView: 2, spaceBetween: 20 }, 480: { slidesPerView: 1, spaceBetween: 10 } } }) if($(window).width()<=767){ if($(".index-part03 li").size()<=1){ $(".index-part03 .swiper-button-prev,.index-part03 .swiper-button-next").hide(); } } else if($(window).width()>1023){ if($(".index-part03 li").size()<=3){ $(".index-part03 .swiper-button-prev,.index-part03 .swiper-button-next").hide(); } } else if(767<$(window).width()<=1023){ if($(".index-part03 li").size()<=2){ $(".index-part03 .swiper-button-prev,.index-part03 .swiper-button-next").hide(); } } } //IndPart02--public_ajax function public_ajax() { if($(".ajLoad").length>0){ var $resourceTypeList = $('.ajLoad ul'); $resourceTypeList.infinitescroll({ navSelector: "#public_more", nextSelector: "#public_more a", itemSelector: ".public_li", clickb: true, clickobj: ".public_loadmore", loading: { img: "../images/loading.gif", msgText: ' ', finishedMsg: '', finished: function() { $("#infscr-loading").hide(); imgratio(); } }, errorCallback: function() { $(".public_loadmore").after("
娌℃湁浜咟/div>"); $(".public_loadmore").hide(); setTimeout(function () { $(".finMessage").fadeOut(); }, 500) } }, function(newElements) { var $newElems = $(newElements); $newElems.fadeIn(); return; }); } } //--------------鐐瑰嚮鍒嗕韩 function share(){ $(".share_wb").click(function () {//寰崥 var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "http://service.weibo.com/share/share.php?title=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op) }) $(".share_kj").click(function () {//QQ绌洪棿 var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "https://qzone.qq.com/?url=" + encodeURIComponent(url) + ""; window.open(op); }) $(".share_qq").click(function () {//QQ var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "http://connect.qq.com/widget/shareqq/index.html?url=" + encodeURIComponent(url) + ""; window.open(op); }) $(".share_qqkj").click(function () {//鑵捐寰崥 var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?title=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op) }) $(".share_in").click(function () {//linkedin var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "https://www.linkedin.com/uas/login?title=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op); }) $(".share_zh").click(function () {//鐭ヤ箮 var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "https://www.zhihu.com/signin?next=%2F?title=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op); }) /*$(".share_bdtb").click(function () {//鐧惧害璐村惂 var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "http://tieba.baidu.com/f/commit/share/openShareApi?title=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op); }) $(".share_douban").click(function () {//璞嗙摚 var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "https://www.douban.com/share/service?title=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op); })*/ //寰俊 $(".share_wx").attr("data-qrcode","http://www.xinhongru.com/qrcode/qrcode.php?content="+window.location.href); $(".share_wx").click(function () {//寰俊 //var url = "/qrCode/Index.aspx?url=" + window.location.href; var url = $(this).attr("data-qrcode") console.log(url) var title = "" title += "
" title += "x" title += "

浜岀淮鐮?/h2>" title += "
" title += "

鎵竴鎵?/p>" title += "

" $("body").remove(".weixin"); $("body").append(title) }) $(document).on("click", ".weixin .c", function () { $(".weixin").remove(); }) } function GetQueryString(parm) { var reg = new RegExp("(^|&)"+ parm +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); //console.log(r);//["&name=222", "&", "222", "", index: 4, input: "id=1&name=222"] if(r!=null) { return unescape(r[2]); } else { return null; } } //ajax function caseAjax(str,url){ $.ajax({ url:url, success:function(msg){ $(str).html(""); $(str).append(msg); wowInt(); digitInt(); } }); } //wow鍏ュ満 function wowInt(){ if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){ var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: -100, mobile: true, live: true }); wow.init(); }; } /*鎵嬫満绔摼鎺ユ敼涓烘湰绐楀彛鎵撳紑*/ function phoneTargetSelf(context){ if ($(window).width()<1024) { if(context==undefined){ context=$(document); } $('a',context).each(function(){ var target=$(this); var link=target.attr('target'); target.attr('target','_self'); }) } } /*鐢佃瘽閾炬帴鍙栨秷榛樿浜嬩欢骞舵坊鍔犳牱寮?/ function findTel(context){ if ($(window).width()>1024) { var condition = /^tel\:([0-9\-]+)|tel\:\+([0-9\-]+)$/; if(context==undefined){ context=$(document); } $('a',context).each(function(index, el) { var target=$(this); var href=target.attr('href'); if (condition.test(href)) { target.addClass('tel_link'); target.on('click',function(event){ event.preventDefault(); }) } }); } } function wowDelay(box,row,delayTime){ $(box).children().each(function(index){ for(var i = 0;i'); var pwdPlaceholder = $(this).siblings('.login-input'); pwdPlaceholder.show(); pwdField.hide(); pwdPlaceholder.focus(function(){ pwdPlaceholder.hide(); pwdField.show(); pwdField.focus(); }); pwdField.blur(function(){ if(pwdField.val() == '') { pwdPlaceholder.show(); pwdField.hide(); } }); } ); }; }) // 鍒ゆ柇娴忚鍣ㄦ槸鍚︽敮鎸乸laceholder灞炴€ function placeholderSupport() { return 'placeholder' in document.createElement('input'); } // jQuery鏇挎崲placeholder鐨勫鐞 function input(obj, val) { var $input = obj; var val = val; $input.attr({value:val}); $input.focus(function() { if ($input.val() == val) { $(this).attr({value:""}); } }).blur(function() { if ($input.val() == "") { $(this).attr({value:val}); } }); } //end