$(function(){ $('.yztHomeBox_amin').each(function(){ var index=$(this).index(); swpt(index) }) $('.rightcity2').on('click',function(){ $('.rightcity').show(); $(this).hide(); setTimeout(function(){ $('.rightcity').hide(); $('.rightcity2').show(); },5000) }) var topposrt = $('.yztHome_head').offset().top+$('.yztHome_head').height(); $(window).scroll(function(){ if($('.lisnt a').hasClass('active')){ //判断css on 是否存在 $('.lisnt2 a').html($('.lisnt a.active').html()) } }); $('.lisnt a').each(function(){ if($(this).hasClass('active')){ //判断css on 是否存在 $('.lisnt2 a').html($('.lisnt a.active').html()) } }) $('.rightcity_maim').smint({ 'scrollSpeed' : 100 }); $('.applyct').on('click',function(){ group(); }) $('.tanchung_gb,.tanchung_bg').on('click',function(){ delbox() }) //报名验证提交的调用 侧边栏 PublicAction.AjaxSend({CORID:'a_buttom'/*操作ID*/}); $('.submit_area .a_buttom').on('click',function(){ setTimeout(function(){ var _html = $('.alert-container .alert-content').html(); if(_html == '提交成功'){ $('.in_ti').val(''); delbox(); } console.log(_html) },300) }) }) function swpt(id){ var mySwiper = new Swiper('.SwiperList_box'+id,{ autoplay:5000, //自动切换 loop : true, //循环 pagination: '.swiper-pagination'+id, // 如果需要分页器 slidesPerView : 1, slidesPerGroup : 1, observer:true,//修改swiper自己或子元素时,自动初始化swiper }) } function group(){ iBoxWidth = $(".tanchung").width(); iBoxHeight = $(".tanchung").height(); iWinWidth = $(window).width(); iWinHeight = $(window).height(); $(".tanchung").show(); $(".tanchung").css("left", (iWinWidth / 2 - iBoxWidth / 2) + "px"); $(".tanchung").animate({"top":((iWinHeight / 2 - iBoxHeight / 2)-50) + "px"},500); $(".tanchung_bg").height(document.body.offsetHeight); $(".tanchung_bg").show(); } function delbox(){ $(".tanchung").hide(); $(".tanchung").css("top", "-100%"); $(".tanchung_bg").hide(); } function move(){ $(".tanchung").css("top", "-30px"); }