$(function () { prohibit(); wowInt(); findTel(); phoneTargetSelf(); nav(); wowDelay(".index_plan01 ul",$('.index_plan01 ul li').length,"0.2"); wowDelay(".index_plan02 ul",$('.index_plan02 ul li').length,"0.2"); wowDelay(".index_05 .right ul",$('.index_05 .right ul li').length,"0.2"); wowDelay(".ofd_02 ul",$('.ofd_02 ul li').length,"0.2"); wowDelay(".service_list ul",$('.service_list ul li').length,"0.2"); wowDelay(".service_contact ul",$('.service_contact ul li').length,"0.2"); wowDelay(".service_down ul",$('.service_down ul li').length,"0.2"); wowDelay(".about_flow ul",$('.about_flow ul li').length,"0.2"); backup(); $(window).resize(); $(document).on("click",".site_close",function(){ $(".site_bar").toggleClass("shouqi"); $(".site_bar").removeClass("cur"); }) $(document).on("click",".site_arrow",function(){ $(".site_bar").removeClass("shouqi"); }) $(document).on("click",".site_customer",function(){ $(".site_bar").toggleClass("cur"); }) if($(window).width()>767){ ScollText(".dl_02 dd") ScollText(".pro_light p") } if($(window).width()>1024){ ScollText(".ofd_edit"); ScollText(".scene_cont"); ScollText(".pro_worth_box"); ScollText(".brightened_list li p"); ScollText(".descript_list li p"); ScollText(".pro_worth .right"); $(".site_bar").hover(function () { if($(this).hasClass("shouqi")){ console.log("bbb") $(this).removeClass("on") }else{ console.log("aaa") $(this).addClass("on") } },function () { $(this).removeClass("on") }) $(".site_bar.shouqi").hover(function () { $(this).removeClass("on") }) } if($(window).width()<24){ $(".phone_btn").attr("href","javascript:void(0);"); $(document).on("click",".phone_btn",function(){ $(".blank_60,.phone_tips").stop().fadeIn(); }) $(document).on("click",".phone_close,.blank_60",function(){ $(".blank_60,.phone_tips").stop().fadeOut(); }) } $(document).on("click",".arrow_open a",function(){ $(".about_address_02").toggleClass("cur"); }) $(document).on("click",".pro_cost_list .right li",function(){ $(this).addClass("on").siblings().removeClass("on"); $(".pro_cost_list .left li").eq($(this).index()).show().siblings().hide(); imgratio(); }) $(document).on("click",".product_tab li",function(){ $(this).addClass("on").siblings().removeClass("on"); $(".product_table_c li").eq($(this).index()).show().siblings().hide(); }) $(".product_table").each(function(){ var $this=$(this); if($this.find("tr").length<=1){ $(this).addClass("cur"); } }) if($(window).width()>1024){ $(".pro_worth .right li").eq(0).addClass("on"); $(document).on("click",".pro_worth .right li",function(){ $(this).addClass("on").siblings().removeClass("on"); $(".pro_worth .left li").eq($(this).index()).show().siblings().hide(); imgratio(); }) } var clipboard = new ClipboardJS('.group_a'); clipboard.on('success', function(e) { // layer.msg('复制成功!'); alert("链接复制成功"); }); clipboard.on('error', function(e) { console.log(e); }); }) function nav(){ $(window).scroll(function () { if ($(this).scrollTop() > 0) { $('body').addClass('scrollHeader'); } else { $('body').removeClass('scrollHeader'); } }); if($(window).width()>1024){ $(".nav li").hover(function(){ $(this).find(".nav_list").stop().fadeIn(); $(this).siblings().find(".nav_list").stop().fadeOut(); $(this).addClass("one").siblings().removeClass("one"); },function(){ $(this).find(".nav_list").stop().fadeOut(); $(this).removeClass("one"); }) $(".nav_01 .nav_p p").hover(function(){ $(this).addClass("on").siblings().removeClass("on"); $(this).parents(".nav_le").siblings(".nav_re").find("dl").eq($(this).index()).show().siblings().hide(); // $(".nav_01 .nav_re dl").eq($(this).index()).show().siblings().hide(); }) }else{ $(".menu_button").click(function(){ $(this).toggleClass("visible_nav"); $("body").toggleClass("navbody"); $(".nav>ul>li").removeClass("cur"); }) } $(".nav>ul>li>span").click(function(){ $(this).parent("li").addClass("cur"); }) $(".return_a").click(function(){ $(this).parents("li").removeClass("cur"); }) if($(window).width()<1025){ $(".header_box").on('touchmove',function(event){ event.preventDefault(); event.stopPropagation(); }) } } function ScollText(obj){ if($(obj).length>0){ $(obj).mCustomScrollbar({ mouseWheelPixels:500, autoDraggerLength:false, advanced: { autoScrollOnFocus: "" } }); } } function wowDelay(box,row,delayTime){ $(box).children().each(function(index){ for(var i = 0;i1024) { 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的placeholder包含密码框的兼容*/ $(function() { // 如果不支持placeholder,用jQuery来完成 if(!isSupportPlaceholder()) { // 遍历所有input对象, 除了密码框 $('input').not("input[type='password']").each( function() { var self = $(this); var val = self.attr("placeholder"); input(self, val); } ); /**//* 对password框的特殊处理 * 1.创建一个text框 * 2.获取焦点和失去焦点的时候切换 */ $('input[type="password"]').each( function(i) { var pwdField = $(this); var pwdVal = pwdField.attr('placeholder'); var pwdId = pwdField.attr('id'); // 重命名该input的id为原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(); } }); } ); } }); // 判断浏览器是否支持placeholder属性 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(){ $(".vide0_close").click(function() { $("body").removeClass("lightbox-noscrol"); $(this).parents(".video_appbox").removeClass("show") $(".video_t").html("") }); var srcl="",simg=''; //高度计算 $(".video_button").click(function(e){ $("body").addClass("lightbox-noscrol"); srcl=$(this).data("video"); simg=$(this).data("img"); $(".video_appbox").addClass("show") video(); }) $(".video_appbox .mask").click(function(){ $("body").removeClass("lightbox-noscrol"); $(".video_appbox").removeClass("show") $(".video_t").html("") }) function video(){ $(".video_t").html("") $(".video_t video").attr({width:$(".video_t").width(),height:$(".video_t").height()}) } }) function prohibit(){ //禁止双指放大 document.documentElement.addEventListener('touchstart', function (event) { if (event.touches.length > 1) { event.preventDefault(); } }, false); //禁止双击放大 var lastTouchEnd = 0; document.documentElement.addEventListener('touchend', function (event) { var now = Date.now(); if (now - lastTouchEnd <= 300) { event.preventDefault(); } lastTouchEnd = now; }, false); //禁止双指放大 兼容苹果浏览器 window.onload = function() { var lastTouchEnd = 0; document.addEventListener('touchstart', function(event) { if (event.touches.length > 1) { event.preventDefault(); } }); document.addEventListener('touchend', function(event) { var now = (new Date()).getTime(); if (now - lastTouchEnd <= 300) { event.preventDefault(); } lastTouchEnd = now; }, false); document.addEventListener('gesturestart', function(event) { event.preventDefault(); }); document.addEventListener('dblclick', function (event) { event.preventDefault(); }) } } function backup(){ $(".back_top").click(function(){ $("html,body").stop().animate({scrollTop:0}); }) $(window).scroll(function(){ if($(window).scrollTop()>0){ $(".back_top").show(); }else{ $(".back_top").hide(); } }) }