$(function () { wowInt(); findTel(); phoneTargetSelf(); $(window).resize(); $(".foot_re .ewm_top li").hover(function(){ $(this).addClass("on").siblings().removeClass("on"); $(".ewm_img li").eq($(this).index()).addClass("on").siblings().removeClass("on"); },function(){ }) setTimeout(function () { $('.common-loading').hide() },1000) search(); nav(); ScollText(".pub_message_form"); $(".site_a03").click(function(){ $(".message_blank,.pub_message").fadeIn(); }) $(".message_close").click(function(){ $(".message_blank,.pub_message").fadeOut(); }) $(".site ul li").hover(function(){ $(this).addClass("cur").siblings().removeClass("cur"); },function(){ $(".site ul li").removeClass("cur"); }) // $(".site ul li").click(function(e){ // e.preventDefault(); // e.stopPropagation(); // $(this).toggleClass("cur").siblings().removeClass("cur"); // }) // $(document).click(function(){ // $(".site ul li").removeClass("cur"); // }) $(".menu-pc").click(function () { $(this).siblings(".pc_nav").toggleClass("on") }) }) function wowDelay(box,row,delayTime){ $(box).children().each(function(index){ for(var i = 0;i 0) { $('body').addClass('scrollHeader'); } else { $('body').removeClass('scrollHeader'); } }); if($(window).width()>1024){ $(".nav li").hover(function(e){ e.stopPropagation() $(this).find(".nav_list").stop().fadeIn(); $(this).siblings().find(".nav_list").stop().fadeOut() $(".nav").css("zIndex",3) },function(e){ e.stopPropagation() $(this).find(".nav_list").stop().fadeOut() $(".nav").css("zIndex",1) }) $(".nav_list").hover(function (e) { e.stopPropagation() },function (e) { e.stopPropagation() $(this).stop().fadeOut() }) }else{ $(".menu_button").click(function(){ $(this).toggleClass("visible_nav"); $("body").toggleClass("navbody"); // $(".nav>ul>li").removeClass("cur"); }) // $(".nav").on('touchmove',function(event){ // event.preventDefault(); // event.stopPropagation(); // }) // $(document).on("click",".nav_arrow",function(){ // $(this).parent("li").toggleClass("cur"); // $(this).parent("li").siblings().removeClass("cur"); // $(this).siblings(".nav_list").stop().slideToggle(); // $(this).parent("li").siblings().find(".nav_list").stop().slideUp(); // }) } //if($(window).width()<1024 && $(window).width()>767){ // $(document).on("click",".nav_arrow",function(){ // $(this).parent("li").toggleClass("cur"); // $(this).parent("li").siblings().removeClass("cur"); // $(this).siblings(".nav_list").stop().slideToggle(); // $(this).parent("li").siblings().find(".nav_list").stop().slideUp(); // }) //} if($(window).width()<1024){ $(document).on("click",".phoneClick",function(){ $(this).parent("li").toggleClass("cur"); $(this).parent("li").siblings().removeClass("cur"); $(this).siblings(".nav_list").stop().slideToggle(); $(this).parent("li").siblings().find(".nav_list").stop().slideUp(); }) } // $(".nav_arrow").click(function(){ // $(this).parent("li").toggleClass("cur"); // $(this).parent("li").siblings().removeClass("cur"); // $(this).siblings(".nav_list").stop().slideToggle(); // $(this).parent("li").find(".nav_list").stop().slideUp(); // }) // $(".return_a").click(function(){ // $(this).parents("li").removeClass("cur"); // }) } function search(){ $(".search span").click(function(e){ e.preventDefault(); e.stopPropagation(); $(".search").toggleClass("cur"); }) $(".search_box").click(function(e){ e.preventDefault(); e.stopPropagation(); }) $(document).click(function(){ $(".search").removeClass("cur"); }) } 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 ScollText(obj){ if($(obj).length>0){ $(obj).mCustomScrollbar({ mouseWheelPixels:500, autoDraggerLength:false, advanced: { autoScrollOnFocus: "" } }); } } /*手机端链接改为本窗口打开*/ 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的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 var InterValObj; //timer变量,控制时间 var count = 60; //间隔函数,1秒执行 var curCount;//当前剩余秒数 var code = ""; //验证码 function sendMessage01() { curCount = count; //设置button效果,开始计时 $("#btnSendCode01").attr("disabled", "true"); //$("#btnSendCode01").val( + curCount + "秒再获取"); $(".code_text").text( + curCount + "秒再获取"); $("#btnSendCode01").hide(); $(".code_text").show(); InterValObj = window.setInterval(SetRemainTime01, 1000); //启动计时器,1秒执行一次 } //timer处理函数 function SetRemainTime01() { if (curCount == 0) { window.clearInterval(InterValObj);//停止计时器 $("#btnSendCode01").removeAttr("disabled");//启用按钮 $("#btnSendCode01").val("重新发送"); code = ""; //清除验证码。如果不清除,过时间后,输入收到的验证码依然有效 $(".code_text").hide(); $("#btnSendCode01").show(); } else { curCount--; //$("#btnSendCode01").val( + curCount + "秒再获取"); $(".code_text").text( + curCount + "秒再获取"); $("#btnSendCode01").hide(); $(".code_text").show(); } } function ScollText(obj){ if($(obj).length>0){ $(obj).mCustomScrollbar({ mouseWheelPixels:500, autoDraggerLength:false, advanced: { autoScrollOnFocus: "" } }); } }