$(function () { wowInt(); findTel(); phoneTargetSelf(); nav(); search(); index_animate(); historyslider(); $(window).resize(); aboutslider() if($(window).width()>1024){ ScollText(".about_edit"); ScollText(".c_text"); ScollText(".history_p"); } if($(window).width()>767){ ScollText(".about_03 dd"); ScollText(".culture_edit"); } ScollText(".about_slider dd p"); ScollText(".investment_01 ul li .dinginveset p"); $(document).on("click",".social_tab li",function(){ $(this).addClass("on").siblings().removeClass("on"); $(".social_cont .social_edit").eq($(this).index()).show().siblings().hide(); }) $(document).click(function () { $(".foot_select dd").slideUp(); $(".foot_select dt").removeClass('on'); }) $(document).on("click",".foot_select dt",function(e){ e.preventDefault(); e.stopPropagation(); $(this).toggleClass("on"); $(this).siblings("dd").slideToggle(); }) }) function index_animate(){ if($(window).width()>1024){ if ($('.culture_03 li').length>0) { $('.culture_03 li').each(function(index, el) { var target=$(this); target.mouseover(function(event) { var index=target.index(); console.log(index) if(index<8){ $(this).addClass("on").siblings().removeClass("on"); $('.culture_03').attr('class','culture_03 state_'+(index+1)); } }); }); } } } function nav(){ $(window).scroll(function () { if ($(this).scrollTop() > 0) { $('body').addClass('scrollHeader'); } else { $('body').removeClass('scrollHeader'); } }); if($(window).width()>1024){ $(".header_2 .nav li").hover(function(){ $(this).find(".nav_list").stop().slideDown(); $(this).siblings().find(".nav_list").stop().slideUp() },function(){ $(this).find(".nav_list").stop().slideUp() }) $(".header_1 .nav li").hover(function(){ $(this).find(".nav_list").stop().slideDown(); $(this).siblings().find(".nav_list").stop().slideUp() },function(){ $(this).find(".nav_list").stop().slideUp() }) // $(document).on("click",".nav_list p",function(e){ // $(".nav_list").hide(); // }) }else{ $(".menu_button").click(function(){ $("body").toggleClass("navbody"); }) $(document).on("click",".nav_list .nav_p p,.menu_close",function(e){ $("body").removeClass("navbody"); }) } $(".nav>ul>li>span").click(function(){ $(this).parent("li").addClass("cur"); }) $(".return_a").click(function(){ $(this).parents("li").removeClass("cur"); }) if($(window).width()<1025){ $(".nav").on('touchmove',function(event){ event.preventDefault(); event.stopPropagation(); }) } } function search() { $(document).on("click",".search_btn",function(e){ e.preventDefault(); e.stopPropagation(); $(this).toggleClass('on') $(this).siblings('.search_box').toggleClass('on'); $("body").removeClass("navbody"); }) $(document).on("click",".search_box",function(e){ e.preventDefault() e.stopPropagation() }) $(document).on("click",".search_box_btn",function(){ $('.search_btn').removeClass('on'); $('.search_box').removeClass('on'); }) $(document).click(function () { $('.search_btn').removeClass('on'); $('.search_box').removeClass('on'); $(".language dd").slideUp(); $(".language dt").removeClass('on'); }) $(document).on("click",".language dt",function(e){ e.preventDefault(); e.stopPropagation(); $(this).toggleClass("on"); $(this).siblings("dd").slideToggle(); }) } function ScollText(obj){ if($(obj).length>0){ $(obj).mCustomScrollbar({ mouseWheelPixels:500, autoDraggerLength:false, advanced: { autoScrollOnFocus: "" } }); } } function wowInt(){ if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){ var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 100, mobile: false, 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() { // 濡傛灉涓嶆敮鎸乸laceholder锛岀敤jQuery鏉ュ畬鎴 if(!isSupportPlaceholder()) { // 閬嶅巻鎵€鏈塱nput瀵硅薄, 闄や簡瀵嗙爜妗 $('input').not("input[type='password']").each( function() { var self = $(this); var val = self.attr("placeholder"); input(self, val); } ); /**//* 瀵筽assword妗嗙殑鐗规畩澶勭悊 * 1.鍒涘缓涓€涓猼ext妗 * 2.鑾峰彇鐒︾偣鍜屽け鍘荤劍鐐圭殑鏃跺€欏垏鎹 */ $('input[type="password"]').each( function(i) { var pwdField = $(this); var pwdVal = pwdField.attr('placeholder'); var pwdId = pwdField.attr('id'); // 閲嶅懡鍚嶈input鐨刬d涓哄師id鍚庤窡1 pwdField.after(''); var pwdPlaceholder = $('#' + pwdId + ''+i+''); 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 isSupportPlaceholder() { var input = document.createElement('input'); return 'placeholder' in 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 function aboutslider(){ if($(".about_slider li").length>1){ $(".about_slider .a_but").show(); var brand3Swiper = new Swiper('.about_slider .swiper-container', { slidesPerView: 1, slidesPerGroup: 1, spaceBetween: 0, speed:1000, prevButton:'.about_slider .swiper-button-prev', nextButton:'.about_slider .swiper-button-next', }) } } function historyslider(){ if($(window).width()>767){ if($(".history_slider li").length>3){ $(".history_slider .his_but").show(); } }else{ if($(".history_slider li").length>1){ $(".history_slider .his_but").show(); } } if($(".history_slider li").length>1){ var brand3Swiper = new Swiper('.history_slider>.swiper-container', { slidesPerView: 3, slidesPerGroup: 1, spaceBetween: 0, speed:1000, prevButton:'.history_slider .his_but .swiper-button-prev', nextButton:'.history_slider .his_but .swiper-button-next', breakpoints:{ 767: { slidesPerView: 1, }, } }) } if($(".history_picture .swiper-slide").length>1){ $(".history_picture .a_but").show(); for(var i=0; i<$(".history_slider li").size(); i++){ $(".history_slider li").eq(i).find(".history_picture .swiper-container").addClass("swiper-container"+i) $(".history_slider li").eq(i).find(".history_picture .swiper-button-prev").addClass("swiper-button-prev"+i) $(".history_slider li").eq(i).find(".history_picture .swiper-button-next").addClass("swiper-button-next"+i) var brand3Swiper = new Swiper('.history_picture .swiper-container'+i, { slidesPerView: 1, slidesPerGroup: 1, spaceBetween: 0, speed:1000, prevButton:'.history_picture .swiper-button-prev'+i, nextButton:'.history_picture .swiper-button-next'+i, }) } } } function aboutsSlider(){ if($(window).width()>1024){ if($(".abouts_02 li").length>2){ $(".abouts_02 .his_but").show(); }else{ $(".abouts_02").addClass("cur"); } }else{ if($(".abouts_02 li").length>1){ $(".abouts_02 .his_but").show(); } } if($(".abouts_02 li").length>2){ var mySwiper = new Swiper('.abouts_02 .swiper-container',{ loop: true, speed:1000, slidesPerView: "auto", centeredSlides:true, loopAdditionalSlides:100, spaceBetween: "2%", prevButton:'.abouts_02 .swiper-button-prev', nextButton:'.abouts_02 .swiper-button-next', autoplayDisableOnInteraction : false, breakpoints:{ //褰撳搴﹀皬浜庣瓑浜?024 1024: { slidesPerView: 1, spaceBetween: 0, }, } }) } } $(function(){ $(".back_top").click(function(){ $("html,body").stop().animate({scrollTop:0}); }) $(window).scroll(function(){ if($(window).scrollTop()>0){ $(".back_top").show().stop().animate({"opacity":1}); }else{ $(".back_top").stop().animate({"opacity":0},function(){ $(".back_top").hide(); }); } }) })