$(function () { if (isIE()) {         var aList = $("a");         aList.each(function () {           var str = "file=";           var href = $(this).attr("href");           if (href) {             var fileIndex = href.indexOf(str);             if (fileIndex !== -1) {               $(this).attr("href", href.substring(fileIndex + str.length));             }           }         });       }       // 检测是否为IE浏览器       function isIE() {         const ua = window.navigator.userAgent;         const msie = ua.indexOf("MSIE "); // IE 10 或更早的版本         const trident = ua.indexOf("Trident/"); // IE 11         return msie > 0 || trident > 0;       } //消除摘要里的空格 $(".news_con .txt").each(function() {   var html = $(this).html();   html = html.replace(/^(\s| )+|(\s| )+$/g, '');   $(this).html(html); }) //子栏目以及详情页获取banner var gps=$('.ser_nav span a').eq(1).attr('href') $('#banner').load(gps+' .banner') //只有一页时不展示分页 var pagelength= $( "input[name='article_paging_list_hidden']") .attr("totalpage") if(pagelength >1){ $(".newsul_pag").show() }else{ $(".newsul_pag").hide() } // 首页 if (typeof (Swiper) != 'undefined' && $('.swiper-container_index')){ var imgNumber = $(".swiper-container_index .swiper-slide").length; // 获取滑块当前图片数量 if (imgNumber > 1) { console.log(imgNumber) // 滚动效果 var swiper1 = new Swiper('.swiper-container_index', { autoplay: { delay: 3000, disableOnInteraction: false, }, loop: true, effect: 'fade', pagination: { el: '.swiper-pagination', type: 'custom', renderCustom: function (swiper, current, total) { return '' + (current > 9 ? current : '0' + current) + '' + ' / ' + '' + (total > 9 ? total : '0' + total) + ''; } }, }); } else { var swiper1 = new Swiper('.swiper-container_index', { autoplay: 3000, paginationClickable: true, autoplayDisableOnInteraction: false, // 若只有一个的时候不让左右切换,就将loop的值变为false,若多个需要循环值为:true, loop: false, pagination: { el: '.swiper-pagination', type: 'custom', renderCustom: function (swiper, current, total) { return '' + (current > 9 ? current : '0' + current) + '' + ' / ' + '' + (total > 9 ? total : '0' + total) + ''; } }, }); } } if (typeof (Swiper) != 'undefined' && $('.swiper-container_ywly')){ var swiper2 = new Swiper('.swiper-container_ywly', { autoplay:{ delay: 5000, disableOnInteraction: false, }, loop: true, pagination: { el: '.swiper-pagination', type: 'custom', renderCustom: function (swiper, current, total) { return '' + (current > 9 ? current: '0'+current) + ''+' / ' +'' + (total > 9 ? total: '0' +total) + ''; } }, }); } //临时公告 if (typeof (Swiper) != 'undefined' && $('#swiper_gg')){ var swiper_gg = new Swiper('#swiper_gg', { loop: true, //允许从第一张到最后一张,或者从最后一张到第一张 循环属性 slidesPerView: 2, // 设置显示三张 freeMode: true, // 使幻灯片滑动时不止滑动一格,且不会自动贴合 slidesPerGroup: 1, //定义1张图片为一组 autoplay: true, //可选选项,自动滑动 direction: 'vertical', autoplay: { delay: 3000, disableOnInteraction: true, stopOnListSlide: true, autoplayDisableOnInteraction: false, }, }); $('#swiper_gg').mouseenter(function () { swiper_gg.autoplay.stop(); }) // // 鼠标移出开始自动滚动 $('#swiper_gg').mouseleave(function () { swiper_gg.autoplay.start(); }) } if (typeof (Swiper) != 'undefined' && $('#swiper_gg1')){ var swiper_gg1 = new Swiper('#swiper_gg1', { loop: true, //允许从第一张到最后一张,或者从最后一张到第一张 循环属性 slidesPerView: 2, // 设置显示三张 freeMode: true, // 使幻灯片滑动时不止滑动一格,且不会自动贴合 slidesPerGroup: 1, //定义1张图片为一组 autoplay: true, //可选选项,自动滑动 direction: 'vertical', autoplay: { delay: 3000, disableOnInteraction: true, stopOnListSlide: true, autoplayDisableOnInteraction: false, }, }); $('#swiper_gg1').mouseenter(function () { swiper_gg1.autoplay.stop(); }) // // 鼠标移出开始自动滚动 $('#swiper_gg1').mouseleave(function () { swiper_gg1.autoplay.start(); }) } // 社会责任 if (typeof (Swiper) != 'undefined' && $('.s_rswiper11')){ var s_rswiper11 = new Swiper('.s_rswiper11', { autoplay:{ delay: 3000, disableOnInteraction: false, }, loop: true, pagination: { el: '.s_rpag1', clickable: true, } }) } // 发展历程 if (typeof (Swiper) != 'undefined' && $('.fzlc_s')){ var swiper3 = new Swiper('.fzlc_s', { autoplay:{ delay: 3000, disableOnInteraction: false, }, loop: true, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, }); $('.fzlc_s').mouseenter(function () { swiper3.autoplay.stop(); }) // // 鼠标移出开始自动滚动 $('.fzlc_s').mouseleave(function () { swiper3.autoplay.start(); }) } // 招标招租 if (typeof (Swiper) != 'undefined' && $('#swiper_zbzz')){ var swiper4 = new Swiper('#swiper_zbzz', { loop: true, //允许从第一张到最后一张,或者从最后一张到第一张 循环属性 slidesPerView: 5, // 设置显示三张 //centeredSlides : true, //使当前图片居中显示 freeMode: true, // 使幻灯片滑动时不止滑动一格,且不会自动贴合 slidesPerGroup: 1, //定义1张图片为一组 autoplay: true, //可选选项,自动滑动 // speed: 3000, //设置过度时间 grabCursor: true, //鼠标样式根据浏览器不同而定 direction: 'vertical', autoplay: { delay: 2000, disableOnInteraction: true, stopOnListSlide: true, autoplayDisableOnInteraction: false, }, }); $('#swiper_zbzz').mouseenter(function () { swiper4.autoplay.stop(); }) // // 鼠标移出开始自动滚动 $('#swiper_zbzz').mouseleave(function () { swiper4.autoplay.start(); }) } //if (typeof (Swiper) != 'undefined' && $('#swiper_zbzz2')){ var swiper5 = new Swiper('#swiper_zbzz2', { loop: true, //允许从第一张到最后一张,或者从最后一张到第一张 循环属性 slidesPerView: 5, // 设置显示三张 //centeredSlides : true, //使当前图片居中显示 freeMode: true, // 使幻灯片滑动时不止滑动一格,且不会自动贴合 slidesPerGroup: 1, //定义1张图片为一组 autoplay: true, //可选选项,自动滑动 // speed: 3000, //设置过度时间 grabCursor: true, //鼠标样式根据浏览器不同而定 direction: 'vertical', autoplay: { delay: 2000, disableOnInteraction: true, stopOnListSlide: true, autoplayDisableOnInteraction: false, }, }); $('#swiper_zbzz2').mouseenter(function () { swiper5.autoplay.stop(); }) // // 鼠标移出开始自动滚动 $('#swiper_zbzz2').mouseleave(function () { swiper5.autoplay.start(); }) //} $(window).scroll(function () { var $top = $(window).scrollTop(); var $box = $('.header'); var $index_banner = $('.index_banner') if ($top > 0) { $box.addClass('scrollTop') $index_banner.addClass('top74') } else { $box.removeClass('scrollTop') $index_banner.removeClass('top74') } }); // 手机端导航 $(".nav_btn").click(function () { $(".nav_btn").toggleClass("nav_btn_open"); $(".mobile-nav-box").toggleClass("mobile-nav-box-show"); // $(".wrapper").toggleClass("wrapper-after-show"); $(".boxmask").toggleClass("maskshow"); }) $(".mobile-menu-nav ul li .tit").click(function () { $(this).children("i").toggleClass("icon-angle-down").toggleClass("icon-angle-up").parents("li").siblings().find("i").removeClass("icon-angle-up").addClass("icon-angle-down"); $(this).next(".mobile-second-nav").slideToggle().parent().siblings().find(".mobile-second-nav").slideUp(); $(this).toggleClass("chose").parent().siblings().find(".tit").removeClass("chose"); }) // 视频隐藏 /*var videosrc = $(".sec4_l_video .mask video").attr("src") $(".mask_con .close").click(function () { $(".sec4_l_video .mask").hide() $(".sec4_l_video .mask video").attr("src", "") }) $(".sec4_l_video .play").click(function () { $(".sec4_l_video .mask").show() $(".sec4_l_video .mask video").attr("src", videosrc) })*/ var videosrc = $(".sec4_l_video .mask video").data("src") $(".mask_con .close").click(function () { $(".sec4_l_video .mask").hide() $(".sec4_l_video .mask video").attr("src", "") }) $(".sec4_l_video .play").click(function () { $(".sec4_l_video .mask").show() $(".sec4_l_video .mask video").attr("src", videosrc) }) //$('#video).bind('contextmenu',function() { return false; }); // 验证码 //页面加载时,生成随机验证码 // window.onload = function () { // createCode(4); // } createCode(4); //生成验证码的方法 function createCode(length) { var code = ""; var codeLength = parseInt(length); //验证码的长度 var checkCode = document.getElementById("checkCode"); // 所有候选组成验证码的字符,当然也可以用中文的 var codeChars = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); //循环组成验证码的字符串 for (var i = 0; i < codeLength; i++) { //获取随机验证码下标 var charNum = Math.floor(Math.random() * 62); //组合成指定字符验证码 code += codeChars[charNum]; } if (checkCode) { //为验证码区域添加样式名 checkCode.className = "code"; //将生成验证码赋值到显示区 checkCode.innerHTML = code; } } //检查验证码是否正确 function validateCode() { //获取显示区生成的验证码 var checkCode = document.getElementById("checkCode").innerHTML; //获取输入的验证码 var inputCode = document.getElementById("inputCode").value; console.log(checkCode); console.log(inputCode); if (inputCode.length <= 0) { alert("请输入验证码!"); } else if (inputCode.toUpperCase() != checkCode.toUpperCase()) { alert("验证码输入有误!"); createCode(4); } else { alert("验证码正确"); } } function submit() { var gsname = $("#gsname").val() var title = $("#per").val() var textarea = $("#area").val() var tel = $("#tel").val() var inputCode = $("#inputCode").val() var myreg = /^[1][3,4,5,7,8][0-9]{9}$/; console.log(gsname); if(gsname.length == 0){ $('
').appendTo('body').addClass('alert alert-success').html('公司名称不能为空').show().delay(1000) .fadeOut(); }else if (title.length == 0) { $('
').appendTo('body').addClass('alert alert-success').html('联系人不能为空').show().delay(1000) .fadeOut(); } else if (textarea.length == 0) { $('
').appendTo('body').addClass('alert alert-success').html('内容不能为空').show().delay(1000) .fadeOut(); } else if (!myreg.test(tel) || textarea.length == 0) { $('
').appendTo('body').addClass('alert alert-success').html('手机号码格式错误').show().delay(1000) .fadeOut(); } else if (inputCode.length == 0) { $('
').appendTo('body').addClass('alert alert-success').html('验证码不能为空').show().delay(1000) .fadeOut(); } else { // var _form = $('form[name=msg]'); // $.ajax({ // url: _form.attr('action'), // data: _form.serialize(), // type: "POST", // success: function (res) { // console.log(res, '---') // if (res.indexOf('success') >= 0) { // var title = $("#per").val("") // var textarea = $("#area").val("") // var tel = $("#tel").val("") // $('
').appendTo('body').addClass('alert alert-success').html('已收到您的留言,我们将尽快回复!') // .show() // .delay(1000) // .fadeOut(); // } else { // $('
').appendTo('body').addClass('alert alert-success').html('验证码错误') // .show().delay(1000) // .fadeOut(); // } // } // }) } } $("#checkCode").click(function () { createCode(4) }) $("#sub").click(function () { // validateCode() submit() }) //招聘动态判断技能标签 $(".job_item_jn span").each(function() { if($(this).text()=='') { $(this).remove(); } }) //截取招聘动态发布日期 if($(".fbtime").length>0){ var mystr = $(".job_l .job_list li .job_item_time .fbtime").html() var mystr1 = mystr.split(" ") mystr = mystr1[0]+mystr1[1] $(".job_l .job_list li .job_item_time .fbtime").html(mystr) } })