$(function () { wowInt(); findTel(); phoneTargetSelf(); nav(); search(); pro_ll(); p_show(); pro_ll_phone(); //椤堕儴鎮诞 $(window).scroll(function(){ if($(window).scrollTop()>0){ $("body").addClass("scroll-header"); }else{ $("body").removeClass("scroll-header"); } }) //鍙充晶婊戝嚭浜岀淮鐮?&鐐瑰嚮閫夋嫨璇█ $(".weix").mouseenter(function() { $(".weix-code").fadeIn(); }) $(".weix").mouseleave(function() { $(".weix-code").fadeOut(); }) $(".pweix").mouseenter(function() { $(".pweix-code").fadeIn(); }) $(".pweix").mouseleave(function() { $(".pweix-code").fadeOut(); }) if($(window).width()>1024){ $('.lang').mouseenter(function(){ $(this).addClass("on"); $(this).find("i").addClass("icon-sha-sj"); }) $('.lang').mouseleave(function(){ $(this).removeClass("on"); $(this).find("i").removeClass("icon-sha-sj"); }) } else{ /*$('.lang').click(function(e){ e.preventDefault(); e.stopPropagation(); $(this).toggleClass("on"); $(this).find("i.icon-xia-sj").toggleClass("icon-sha-sj"); }) $(document).click(function(){ $('.lang').removeClass("on"); })*/ } //end //鎵嬫満绔簳閮 if($(window).width()<769){ $(".foot_top li").map(function(){ if($(this).children(".con").length>0){ $(this).addClass("has_con"); } }) $(document).on('click','.foot_top li.has_con h2',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(); }) } //end //鍏叡閫夐」鍗 $(".tab-box .tab-a").each(function() { $(this).click(function() { if (!$(this).hasClass("off")) { $(this).addClass("on").siblings().removeClass("on"); var ii=$(this).index(); $(this).parents(".tab-box").find(".tab-b").eq(ii).show().siblings().hide(); } }); }) $(".tab-box").each(function (i) { $(this).find(".tab-a:eq(0)").click(); }); //end //涓昏惀涓氬姟 $(document).on("click", ".bus_tit li", function () { $(this).addClass("on").siblings().removeClass("on"); var url = $(this).data("src"); if(url == ""){ return false; }else{ commAjax(".bus_con",url); } }) var _ind = GetQueryString("index"); if(_ind){ $(".bus_tit li:eq(" + _ind + ")").click(); }else{ $(".bus_tit li:eq(0)").click(); } if($(window).width()<1024){ bus_top(); } //end //鏂伴椈-瑙嗛寮圭獥 var srcl="",simg=""; $(".video_button").click(function(e){ srcl=$(this).data("video"); simg=$(this).data("img"); $(".videolist_appbox").fadeIn(); video(); }) $(".videolist_appbox .mask,.videolist_appbox .video_close").click(function(){ $(".videolist_appbox").fadeOut(); $(".video_t").html("") }) function video(){ $(".video_t").html("") $(".video_t video").attr({width:$(".video_t").width(),height:$(".video_t").height()}) } //end }) //浜у搧鏈嶅姟宸︿晶 function pro_ll(){ if($(window).width()>767){ $(document).on("click", ".pro_ll li", function () { $(this).find("dl").slideToggle().parents("li").siblings("li").find("dl").slideUp(); $(this).siblings("li").removeClass("on"); if($(this).hasClass("on")){ $(this).removeClass('on'); } else{ $(this).addClass("on"); } }) //$(".pro_ll li").eq(0).click(); } else{ var pro_ll_swiper = new Swiper('.pro_ll .swiper-container', { slidesPerView: 1, spaceBetween: 0, prevButton:'.pro_ll .swiper-button-prev', nextButton:'.pro_ll .swiper-button-next', }) } } //鎵嬫満绔殑浜у搧鏈嶅姟宸︿晶 function pro_ll_phone() { $(".ty_one").find("dt").click(function (e) { e.preventDefault(); e.stopPropagation(); var el = $(this).parent(".ty_one"); if(el.hasClass('open')){ el.removeClass('open'); }else{ el.addClass('open'); el.next(".ty_two").find("li").find("dl").removeClass('open'); } }) $(".ty_one").find("dd a").each(function (i) { if($(this).hasClass("on")){ $(".ty_one dt").find("a").text($(this).text()); } }) $(".ty_one").find("dd a").click(function () { var inde = $(this).index(); //$(this).addClass("on").siblings().removeClass("on"); var el = $(".ty_one.open"); el.find("dt a").text($(this).text()); el.find("dd a").eq(inde).addClass("on").siblings().removeClass("on"); el.parent(".pro_ll_phone").find(".ty_two").find("li").eq(inde).addClass("on").siblings().removeClass("on"); setTimeout(function () { el.removeClass("open"); },1) }) $(document).click(function () { $(".ty_one.open").removeClass("open"); }) //$(".ty_two li").eq(0).addClass("on"); $(".ty_two li").find("dt").click(function (e) { e.preventDefault(); e.stopPropagation(); var el = $(this).parent("dl"); if(el.hasClass('open')){ el.removeClass('open'); }else{ el.addClass('open'); } }) $(".ty_two li dl").find("dd a").each(function (i) { if($(this).hasClass("on")){ $(".ty_two li dl dt").find("a").text($(this).text()); } }) $(".ty_two li dl").find("dd a").click(function () { var ind = $(this).index(); $(this).addClass("on").siblings().removeClass("on"); var el = $(".ty_two li dl.open"); el.find("dt a").text($(this).text()); el.find("dd a").eq(ind).addClass("on").siblings().removeClass("on"); setTimeout(function () { el.removeClass("open"); },1) }) $(document).click(function () { $(".ty_two li dl.open").removeClass("open"); }) } //浜у搧鏈嶅姟鍙充晶鍒囨崲 function p_show(){ var p_show_swiper = new Swiper('.p_show .swiper-container', { slidesPerView: 4, spaceBetween: 12, prevButton:'.p_show .swiper-button-prev', nextButton:'.p_show .swiper-button-next', breakpoints: { 1024: { slidesPerView: 3, }, 768: { slidesPerView: 2, spaceBetween: 5, }, 360: { slidesPerView: 1, spaceBetween: 0, } } }) } //涓昏惀涓氬姟椤堕儴鏍忕洰鍚嶅垏鎹 function bus_top(){ var _ind = 0; var _len = $(".bus_top .swiper-slide").length; var bustit_swiper = new Swiper('.bus_top .swiper-container', { slidesPerView: 3, spaceBetween: 2, prevButton:'.bus_top .swiper-button-prev', nextButton:'.bus_top .swiper-button-next', breakpoints: { 767: { slidesPerView: 2, } } }) btnJudge(); $(".bus_top .swiper-button-prev").click(function() { _ind--; btnJudge() $(".bus_top .swiper-slide").eq(_ind).addClass("on").siblings().removeClass("on"); $(".bus_top .swiper-slide.on").click(); }) $('.bus_top .swiper-button-next').click(function() { _ind++; btnJudge() $(".bus_top .swiper-slide").eq(_ind).addClass("on").siblings().removeClass("on"); $(".bus_top .swiper-slide.on").click(); }) $(".bus_top .swiper-slide").click(function(){ _ind = $(this).index(); $(this).addClass("on").siblings().removeClass("on"); bustit_swiper.slideTo(_ind, 1000, false); btnJudge(); var url = $(this).data("src"); if(url == ""){ return false; }else{ commAjax(".bus_con",url); } }) var _ind = GetQueryString("index"); if(_ind){ $(".bus_top .swiper-slide:eq(" + _ind + ")").click(); }else{ $(".bus_top .swiper-slide:eq(0)").click(); } //$(".bus_top .swiper-slide").eq(0).click(); function btnJudge() { //console.log(_ind,_len) if(_ind >= _len - 1) { $('.bus_top .swiper-button-next').addClass("disabled") _ind = _len - 1; } else { $('.bus_top .swiper-button-next').removeClass("disabled") } if(_ind <= 0) { $(".bus_top .swiper-button-prev").addClass("disabled") _ind = 0; } else { $(".bus_top .swiper-button-prev").removeClass("disabled") } } } //涓昏惀涓氬姟澶у浘鍒囨崲 function bus_sw(){ if($("html").hasClass("lt10")){ var busswiper = new Swiper('.bus_swiper .swiper-container', { slidesPerView: "1", centeredSlides:false, loopAdditionalSlides:100, spaceBetween: 0, prevButton:'.bus_swiper .swiper-button-prev', nextButton:'.bus_swiper .swiper-button-next', breakpoints: { 767: { slidesPerView: 1, } } }) } else{ var busswiper = new Swiper('.bus_swiper .swiper-container', { //loop:true, slidesPerView: "auto", centeredSlides:true, loopAdditionalSlides:100, spaceBetween: 0, prevButton:'.bus_swiper .swiper-button-prev', nextButton:'.bus_swiper .swiper-button-next', breakpoints: { 767: { slidesPerView: 1, } } }) } if($(".bus_swiper .swiper-slide").size()<=1){ $(".bus_swiper .swiper-button-prev").hide(); $(".bus_swiper .swiper-button-next").hide(); } } //涓昏惀涓氬姟end function commAjax(str,url){ $.ajax({ url:url, success:function(msg){ $(str).html(""); $(str).append(msg); } }); } //涓诲鑸 function nav(){ if($(window).width()>1024){ $(".nav ul>li").hover(function() { $(this).find(".navlist").stop().slideDown(); }, function() { $(this).find(".navlist").stop().slideUp(); }); }else{ $(".navlist").siblings("span").addClass("cur"); $(document).on('click','.nav_phone_btn',function(e){ e.preventDefault(); e.stopPropagation(); $('.nav_phone_btn').toggleClass('visible_nav'); $('body').toggleClass('body_nav_phone'); $(".nav_click").show(); }); $(document).on('click','.nav_click',function(){ $('.nav_phone_btn').removeClass('visible_nav'); $('body').removeClass('body_nav_phone'); $(this).hide(); }) $(document).on('click','.nav ul li span',function(e){ $(this).parent("li").siblings().find("span").removeClass("on"); $(this).parent("li").siblings().find(".navlist").slideUp(); $(this).toggleClass("on"); $(this).siblings(".navlist").slideToggle(); }) } } // 鍦板浘 function mapInt(mapTitle,mapAdress,mapx,mapy){ var num = 0.0011; var map = new BMap.Map("map"); var point = new BMap.Point(mapx-num,mapy); var point2 = new BMap.Point(mapx,mapy); var myIcon = new BMap.Icon("../images/conn_map.png", new BMap.Size(40,47));// icon鎸夐挳 var marker2 = new BMap.Marker(point2,{icon:myIcon}); // 鍒涘缓鏍囨敞 map.addOverlay(marker2); // 灏嗘爣娉ㄦ坊鍔犲埌鍦板浘涓 map.centerAndZoom(point, 19); if($(window).width()<1024){ num = 0; map.centerAndZoom(point2, 19); } /*var opts = { width : 200, height: 100, title : "鑳滃埄娌圭敯澶ф槑闆嗗洟" } var infoWindow = new BMap.InfoWindow("鍦板潃锛氬北涓滅渷涓滆惀甯備笢钀ュ尯鍗冧經灞辫矾20鍙?, opts); // 鍒涘缓淇℃伅绐楀彛瀵硅薄 marker2.addEventListener("click", function(){ map.openInfoWindow(infoWindow,point2); //寮€鍚俊鎭獥鍙 });*/ map.enableScrollWheelZoom(); //鍚敤婊氳疆鏀惧ぇ缂╁皬锛岄粯璁ょ鐢 map.enableContinuousZoom(); //鍚敤鍦板浘鎯€ф嫋鎷斤紝榛樿绂佺敤 } //--------------鐐瑰嚮鍒嗕韩 function share(){ /* $(".share_in").click(function () {//linkedin var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "//www.linkedin.com/uas/login?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_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_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_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_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_wx").attr("data-qrcode","http://www.xinhongru.com/qrcode/qrcode.php?content="+window.location.href); //$(".share_wx").attr("data-qrcode", "/qrCode/Index.aspx?url=" + 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(); }) } if ($(window).width()>767) { if($(".field_slider").size()<5){ $(".field_slider .swiper-button-prev,.field_slider .swiper-button-next").hide(); } } else{ if($(".field_slider").size()<=1){ $(".field_slider .swiper-button-prev,.field_slider .swiper-button-next").hide(); } } //鎼滅储 function search(){ $(document).on("click", ".head_rr span.ser", function (e) { e.preventDefault(); e.stopPropagation(); $(this).toggleClass("on"); $(".search_wrap").toggleClass("on"); }) $(document).on("click", ".search_box_text", function (e) { e.preventDefault(); e.stopPropagation(); }) $(document).click(function(){ $(".search_wrap").removeClass("on"); $("span.ser").removeClass("on"); }) } //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_load-more-link", loading: { img: "../images/loading.gif", msgText: ' ', finishedMsg: '', finished: function() { $("#infscr-loading").hide(); imgratio(); } }, errorCallback: function() { $(".public_load-more-link").after("
娌℃湁浜咟/div>"); $(".public_load-more-link").hide(); setTimeout(function () { $(".finMessage").fadeOut(); }, 500) } }, function(newElements) { var $newElems = $(newElements); $newElems.fadeIn(); return; }); } } 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; } } //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(); }) } }); } } /*ie9鐨刾laceholder鍖呭惈瀵嗙爜妗嗙殑鍏煎*/ $(function(){ if(!placeholderSupport()){ // 鍒ゆ柇娴忚鍣ㄦ槸鍚︽敮鎸 placeholder $('input').not("input[type='password']").each( function() { var self = $(this); var val = self.attr("placeholder"); input(self, val); /*if($(this).val()=="" && $(this).attr("placeholder")!=""){ $(this).val($(this).attr("placeholder")); $(this).focus(function(){ if($(this).val()==$(this).attr("placeholder")) $(this).val(""); }); $(this).blur(function(){ if($(this).val()=="") $(this).val($(this).attr("placeholder")); }); }*/ } ); $('input[type="password"]').each( function() { var pwdField = $(this); var pwdVal = pwdField.attr('placeholder'); var pwdClass = pwdField.attr('class'); // 閲嶅懡鍚嶈input鐨刬d涓哄師id鍚庤窡1 pwdField.after(''); 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