$(function(){ // wowInt(); phoneTargetSelf(); if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){ window.sr = ScrollReveal(); sr.reveal('.wow',config); }; $('.nav_indicator').stop().animate({ 'top':$('.nav_child_layout li').eq(0).position().top+$('.nav_child_layout li').eq(0).outerHeight()/2 }); $('.nav_child_layout li').hover(function(){ $('.nav_indicator').stop().animate({ 'top':$(this).position().top+$(this).outerHeight()/2 },250); },function(){ $('.nav_indicator').stop().animate({ 'top':$('.nav_child_layout li').eq(0).position().top+$('.nav_child_layout li').eq(0).outerHeight()/2 },250); }); $(document).on('click','.nav_phone_btn,.nav_phone_tit .button',function(e){ e.stopPropagation(); $('.nav_phone_btn').toggleClass('visible_nav'); $('body').toggleClass('body_nav_phone'); $('.boxa').toggle(); $('.boxa1').toggle(); }); $('.nav_phone_tit .button').click(function(){ }) $(document).on('click','.nav_phone_con>ul>li',function(){ $(this).addClass('on'); }); $(document).on('click','.nav_phone_con>ul>li ul>li:first-child',function(e){ $('.nav_phone_con>ul>li').removeClass('on'); e.stopPropagation(); }); //加入滑动事件 var mouseX = 0, touchStartY = 0, touchStartX = 0, touchEndY=0, touchEndX=0; $(document).on('mousedown touchstart','.nav_phone',function(e){ if (e.originalEvent.touches){ touchStartY = e.originalEvent.touches[0].clientY; touchStartX = e.originalEvent.touches[0].clientX; }else{ touchStartY = e.clientY; touchStartX = e.clientX; } }); $(document).on('mouseup touchend','.nav_phone',function(e){ if (e.originalEvent.touches){ touchEndY = e.originalEvent.changedTouches[0].clientY; touchEndX = e.originalEvent.changedTouches[0].clientX; }else{ touchEndY = e.clientY; touchEndX = e.clientX; } var yDiff = touchStartY - touchEndY; var xDiff = touchStartX - touchEndX; if ( Math.abs( xDiff ) > Math.abs( yDiff ) ) { if ( xDiff < 5 ) { $('.nav_phone_btn').toggleClass('visible_nav'); $('body').toggleClass('body_nav_phone'); } } }) try{ numbeat($(".abstract03"),$(".abstract03 ul li:nth-child(1) span")); numbeat($(".abstract03"),$(".abstract03 ul li:nth-child(2) span")); numbeat($(".abstract03"),$(".abstract03 ul li:nth-child(3) span")); // numbeat($(".case_info2"),$(".case_info2 ul li:nth-child(4) span")); }catch(e){ //TODO handle the exception } }) function select(){ $(".language dt").click(function (e) { e.preventDefault(); e.stopPropagation(); $(".language dd").slideToggle(200); $(".search_wrap").slideUp(200); $(".header_search").removeClass("on"); }) } function search(){ $(".header_search").click(function (e) { e.preventDefault(); e.stopPropagation(); $(this).toggleClass("on"); $(".search_wrap").slideToggle(200); $(".language dd").slideUp(200) }) $(".search_box_text").click(function (e) { e.preventDefault(); e.stopPropagation(); }) } // $(document).click(function(){ // $(".search_wrap").slideUp(200); // $(".language dd").slideUp(200); // $(".header_search").removeClass("on"); // }) 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 mapInt(mapTitle,mapAdress,mapx,mapy){ var map = new BMap.Map("map"); var point = new BMap.Point(mapx,mapy); var point2 = new BMap.Point(mapx,mapy); //坐标偏移 var point2 = new BMap.Point(mapx+0.05,mapy); var myIcon = new BMap.Icon("../images/map_noprint.png", new BMap.Size(39,53));// icon按钮 var marker2 = new BMap.Marker(point2,{icon:myIcon}); // 创建标注 map.addOverlay(marker2); // 将标注添加到地图中 map.centerAndZoom(point, 20); var opts = { width : 200, // 信息窗口宽度 height: 100, // 信息窗口高度 title : mapTitle // 信息窗口标题 } var infoWindow = new BMap.InfoWindow(mapAdress, opts); marker2.addEventListener("click", function(){ map.openInfoWindow(infoWindow,point); }); map.enableScrollWheelZoom(); //启用滚轮放大缩小,默认禁用 map.enableContinuousZoom(); //启用地图惯性拖拽,默认禁用 } window.onload = function(){ setTimeout(function(){ $(window).scroll(); },300) } $(function(){ $('.header_search span').click(function(e){ e.stopPropagation(); $('.search_wrap').show(); }) $('.search_wrap input , .search_box_button').click(function(e){ e.stopPropagation(); $('.search_wrap').show(); }) $(document).click(function(){ $('.search_wrap').hide(); }) }) function numbeat(wraper,target){ //保证数字跳动只执行一次 var flag = true; var spacenum = 1; var arr = 0; var max = parseFloat(target.attr("rel")); //保证数据结束的统一性 if(max>20){ spacenum = parseInt(max/20); } if($(window).scrollTop() > wraper.offset().top-$(window).height()/1.2){ flag = false; var timer = setInterval(function() { arr = arr + spacenum; arr < max ? arr : clearInterval(timer); if(arr>=max){ target.html(max); }else{ target.html(arr); } }, 100); } $(window).scroll(function(){ if(flag){ if($(window).scrollTop() > wraper.offset().top-$(window).height()/1.2){ flag = false; var timer = setInterval(function() { arr = arr + spacenum; arr < max ? arr : clearInterval(timer); if(arr>=max){ target.html(max); }else{ target.html(arr); } }, 100); } } }) } var config = { reset: false, // 滚动鼠标时,动画开关(默认是false没有打开鼠标滚动的动画开关) origin: 'top', // 动画开始的方向 duration: 1000, // 动画持续时间 delay: 100, // 延迟 rotate: {x:0, y:0, z:0}, // 过度到0的初始角度 opacity: 0.2, // 初始透明度 (0.2到1的效果) scale:0.9, //缩放 easing: 'ease-in-out', mobile: false,//动画效果// 缓动'ease', 'ease-in-out','linear'... // 回调函数 //当动画开始之前会被触发 beforeReveal: function(domEl){ console.log('动画执行了'); }, //鼠标滚轮滚动之前会被触发 beforeReset: function(domEl){ console.log('滚轮开始---'); }, //动画开始之后会被触发 afterReveal: function(domEl){ console.log('动画结束了'); }, //滚轮滚动之后会被触发 afterReset: function(domEl){ console.log('滚轮结束了'); } }; $(function(){ if($(".human_cont li").length>0){ for(var i=0; i<$(".human_cont li").size(); i++){ lc_lightbox('.elem'+i, { wrap_class: 'lcl_fade_oc', thumbs_nav: false, carousel: false, cmd_position : 'inner', nav_btn_pos : 'middle', mousewheel : false, open_close_time : 0, radius: 0, padding : 0, border_w: 0, show_title: true, show_descr: true, data_position : 'under', fading_time:0, //切换加载的时间 }); } } // history_tab($('.abstract04-list li').eq(0)) $(document).on("click",".abstract04-list li",function(){ // var $_this=$(this); // history_tab($_this) // $_this.addClass("on").siblings().removeClass("on"); // imgratio(); // $(".blank50").show(); // $(".touch01-box1").show(); $(this).find('.msgDiv_ul').show().parents("li").siblings("li").find(".msgDiv_ul").hide(); $(this).addClass("on").siblings().removeClass("on"); }) $(".touch01-box1 .close").click(function(){ $(".blank50").hide(); $(".touch01-box1").hide(); }) }) $(document).click(function(event){ var _con = $('.abstract04-list li');      if(!_con.is(event.target) && _con.has(event.target).length === 0){          $('.msgDiv_ul').hide(); $('.abstract04-list li').removeClass("on"); } }) // function history_tab($_this){ // var url=$_this.data("src"); // if(url==null)return false; // $.ajax({ // url:url, // type:"GET", // success: function (msg) { // $(".parBd").html(msg); // imgratio(); // } // }); // }; $(function() { $(".weixin").click(function(){ $(".blank_40,.weixin_box").fadeIn().show(); }) $(".weixin_close,.blank_40").click(function(){ $(".blank_40,.weixin_box").fadeOut().hide(); }) })