$(document).ready(function () { var certifySwiper = new Swiper('.safeCon .swiper-container', { watchSlidesProgress: true, slidesPerView: 'auto', centeredSlides: true, loop: true, loopedSlides: 9, autoplay: true, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, pagination: { el: '.swiper-pagination', clickable: true, }, on: { progress: function (progress) { for (i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i); var slideProgress = this.slides[i].progress; modify = 1; if (Math.abs(slideProgress) > 1) { modify = (Math.abs(slideProgress) - 1) * 0.4 + 1; } translate = slideProgress * modify * 328 + 'px'; scale = 1 - Math.abs(slideProgress) / 9; zIndex = 999 - Math.abs(Math.round(10 * slideProgress)); slide.transform('translateX(' + translate + ') scale(' + scale + ')'); slide.css('zIndex', zIndex); slide.css('opacity', 1); if (Math.abs(slideProgress) > 3) { slide.css('opacity', 0); } } }, setTransition: function (transition) { for (var i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i) slide.transition(transition); } } } }) var certifySwiper = new Swiper('.safeCon1 .swiper-container', { watchSlidesProgress: true, slidesPerView: 'auto', centeredSlides: true, loop: true, loopedSlides: 5, autoplay: true, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, pagination: { el: '.swiper-pagination', clickable: true, }, on: { progress: function (progress) { for (i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i); var slideProgress = this.slides[i].progress; modify = 1; if (Math.abs(slideProgress) > 1) { modify = (Math.abs(slideProgress) - 1) * 0.4 + 1; } translate = slideProgress * modify * 90 + 'px'; scale = 1 - Math.abs(slideProgress) / 5; zIndex = 999 - Math.abs(Math.round(10 * slideProgress)); slide.transform('translateX(' + translate + ') scale(' + scale + ')'); slide.css('zIndex', zIndex); slide.css('opacity', 1); if (Math.abs(slideProgress) > 3) { slide.css('opacity', 0); } } }, setTransition: function (transition) { for (var i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i) slide.transition(transition); } } } }) $('#myTab a:first').tab('show'); $('#myTab a').click(function (e) { e.preventDefault(); $(this).tab('show'); }) $('.panel-group').on('hide.bs.collapse', '.panel-collapse', function (e) { var $this = $(this) console.log(e) // $this.prev().find("span").toggleClass("icon-xiangxiajiantou"); if (e.type == 'hide') { $this.prev().find("span").css('transform', 'rotate(0deg)') } else { $this.prev().find("span").css('transform', 'rotate(-180deg)'); } // if ($('.panel-collapse').hasClass('in')) { // $this.prev().find("span").css('transform', 'rotate(-180deg)'); // } else { // $this.prev().find("span").css('transform', 'rotate(0deg)'); // } }) $('.panel-group').on('show.bs.collapse', '.panel-collapse', function (e) { console.log(e) var $this = $(this) $this.prev().find("span").css('transform', 'rotate(-180deg)'); if (e.type == 'show') { $this.prev().find("span").css('transform', 'rotate(-180deg)'); } else { $this.prev().find("span").css('transform', 'rotate(0deg)') } }) if ($('.panel-collapse').hasClass('in')) { console.log($('.panel-collapse').hasClass('in')) $(this).parents('panel-group').prev().find("span").css('transform', 'rotate(-180deg)'); console.log($(this).parent().parent('.panel-group').find("span")) } else { $('.panel-group').prev().find("span").css('transform', 'rotate(0deg)'); } // $('.dropdown-menu li').click(function() { // $(this).siblings('li').removeClass('cur'); // $(this).addClass('cur'); // }) $('#example-navbar-collapse .dropdow_menu a').click(function (e) { if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { var target = $(this.hash); console.log(target); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top - 40 }, 900); return false; } } }); $(document).off('click.bs.dropdown.data-api'); $('.top').click(function (e) { e.preventDefault(); $("body,html").animate({ scrollTop: 0 }, 500); }); $('.about-video').trigger('play'); //boss 招聘好了,这个打开 // getJobList(); listClick(); joinBtn(); var num = 1; var list = []; $('.loadmore').click(function () { ++num; console.log(num) if (num > 3) { $(this).css('display', 'none') } else { $.ajax({ type: 'get', url: "https://www.cestong.com/cecf/wapi/zpjob/wjd/more/job?sbid=b6f2ee03f7e80a7c1HF_3di6FVE~&page=" + num, dataType: 'json', async: false, success: function (data) { var arr = sessionStorage.getItem('jobList'); list = list.concat(JSON.parse(arr)); list = list.concat(data.zpData.jobList); // list = list.concat(data.zpData.jobList) if (data.code == '0') { var myli = ''; for (var i = 0; i < list.length; i++) { var html = list[i].postDescription.replace(/\n/g, '
'); myli += `
  • 查看详情

    ${list[i].jobName}

    ${list[i].locationName} ${list[i].experienceName} ${list[i].degreeName}
    ${html}
  • ` } $('.list-group').html(myli); listClick(); joinBtn(); } else { layer.msg(data.message); } }, error: function () {}, }); } }) // setTimeout(function () { // $("body,html").animate({ // scrollTop: 860 // }, 1000); // }, 3500) $(window).scroll(function () { if ($(document).scrollTop() < 880) { $('.img1').show(); $('.img2').hide(); $('.header.active').css('background', '#000') $('.header .header_link .header_title').css("color", "#fff") $('.header .header_link.active .header_title').css("color", "#0052D9") } else { $('.img1').hide(); $('.img2').show(); $('.header.active').css('background', '#fff') $('.header .header_link .header_title').css("color", "#434343") $('.header .header_link.active .header_title').css("color", "#0052D9") } }); // $(window).scroll(function () { // if ($(document).scrollTop() < 20) { // $('.about_desc_list_wrap').css('display', 'none'); // } else { // $('.about_desc_list_wrap').css('display', 'block'); // } // }); // var video = document.querySelector('video'); // video.addEventListener('canplay', function () { // this.width = this.videoWidth; // this.height = this.videoHeight; // console.log(this.videoWidth, this.videoHeight) // }) // var videoH = $('.about-video').height() + 60; // $('.head_bg').css("height", videoH + "px"); // console.log($('.head_bg').height(), 'div高度') // $(window).resize(function () { // var h = $('.about-video').height(); // console.log(h, '视频高度') // $('.head_bg').css("height", h + "px"); // console.log($('.head_bg').height(), '变化中div高度') // var w = $(window).width(); // console.log(w, '') // }); var h = $(window).height(); $('.head_bg').css("height", h + "px"); $(window).resize(function () { var vh = $(window).height(); $('.head_bg').css("height", vh + "px"); // var h = $('.about-video').height(); // console.log(h, '视频高度') // $('.head_bg').css("height", h + "px"); // console.log($('.head_bg').height(), '变化中div高度') }); }) // http://39.106.74.84:8045 // 获取职位列表 function getJobList() { $.ajax({ type: 'get', url: "https://www.cestong.com/cecf/wapi/zpjob/wjd/boss/b6f2ee03f7e80a7c1HF_3di6FVE~?sbid=b6f2ee03f7e80a7c1HF_3di6FVE~&aid=", dataType: 'json', async: false, success: function (data) { var list = []; list = list.concat(data.zpData.data.otherJobList) console.log(list, 'aaaa') if (data.code == '0') { var myli = ''; for (var i = 0; i < list.length; i++) { var html = list[i].postDescription.replace(/\n/g, '
    '); myli += `
  • 查看详情

    ${list[i].jobName}

    ${list[i].locationName} ${list[i].experienceName} ${list[i].degreeName}
    ${html}
  • ` } $('.list-group').html(myli); list = JSON.stringify(list) sessionStorage.setItem('jobList', list) } else { layer.msg(data.message); } }, error: function () {}, }); // $('#join').on('shown.bs.modal', function () { // var $this = $(this); // var $modal_dialog = $this.find('.modal-dialog'); // var m_top = ($(window).height() - $modal_dialog.height()) / 2; // $modal_dialog.css({ // 'margin': m_top + 'px auto' // }); // }); } function listClick() { $(".list-group-item").on("click", function (event) { // event = event || window.event; // if (event && event.stopPropagation) { // event.stopPropagation(); // } else { // event.cancelBubble = true; // } $(".list-group-item").find('.info_desc').slideUp(); if ($(this).find('.info_desc').css('display') == 'none') { $(this).find('.info_desc').slideDown() } else { $(this).find('.info_desc').slideUp() } }); } function joinBtn() { $('.join_btn').click(function (event) { console.log(this) event = event || window.event; if (event && event.stopPropagation) { event.stopPropagation(); } else { event.cancelBubble = true; } $('#join').modal('show') }); }