index.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. $(function(){
  2. $('.yztHomeBox_amin').each(function(){
  3. var index=$(this).index();
  4. swpt(index)
  5. })
  6. $('.rightcity2').on('click',function(){
  7. $('.rightcity').show();
  8. $(this).hide();
  9. setTimeout(function(){
  10. $('.rightcity').hide();
  11. $('.rightcity2').show();
  12. },5000)
  13. })
  14. var topposrt = $('.yztHome_head').offset().top+$('.yztHome_head').height();
  15. $(window).scroll(function(){
  16. if($('.lisnt a').hasClass('active')){ //判断css on 是否存在
  17. $('.lisnt2 a').html($('.lisnt a.active').html())
  18. }
  19. });
  20. $('.lisnt a').each(function(){
  21. if($(this).hasClass('active')){ //判断css on 是否存在
  22. $('.lisnt2 a').html($('.lisnt a.active').html())
  23. }
  24. })
  25. $('.rightcity_maim').smint({
  26. 'scrollSpeed' : 100
  27. });
  28. $('.applyct').on('click',function(){
  29. group();
  30. })
  31. $('.tanchung_gb,.tanchung_bg').on('click',function(){
  32. delbox()
  33. })
  34. //报名验证提交的调用 侧边栏
  35. PublicAction.AjaxSend({CORID:'a_buttom'/*操作ID*/});
  36. $('.submit_area .a_buttom').on('click',function(){
  37. setTimeout(function(){
  38. var _html = $('.alert-container .alert-content').html();
  39. if(_html == '提交成功'){
  40. $('.in_ti').val('');
  41. delbox();
  42. }
  43. console.log(_html)
  44. },300)
  45. })
  46. })
  47. function swpt(id){
  48. var mySwiper = new Swiper('.SwiperList_box'+id,{
  49. autoplay:5000, //自动切换
  50. loop : true, //循环
  51. pagination: '.swiper-pagination'+id, // 如果需要分页器
  52. slidesPerView : 1,
  53. slidesPerGroup : 1,
  54. observer:true,//修改swiper自己或子元素时,自动初始化swiper
  55. })
  56. }
  57. function group(){
  58. iBoxWidth = $(".tanchung").width();
  59. iBoxHeight = $(".tanchung").height();
  60. iWinWidth = $(window).width();
  61. iWinHeight = $(window).height();
  62. $(".tanchung").show();
  63. $(".tanchung").css("left", (iWinWidth / 2 - iBoxWidth / 2) + "px");
  64. $(".tanchung").animate({"top":((iWinHeight / 2 - iBoxHeight / 2)-50) + "px"},500);
  65. $(".tanchung_bg").height(document.body.offsetHeight);
  66. $(".tanchung_bg").show();
  67. }
  68. function delbox(){
  69. $(".tanchung").hide();
  70. $(".tanchung").css("top", "-100%");
  71. $(".tanchung_bg").hide();
  72. }
  73. function move(){
  74. $(".tanchung").css("top", "-30px");
  75. }