style.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. $(function(){
  2. // // 轮播图
  3. var mySwiper1 = new Swiper('.lpmain_lp_main',{
  4. autoplay:5000, //自动切换
  5. loop : true, //循环
  6. });
  7. $('body').on('click','.school_buttom',function(){
  8. var lpname=$(this).attr('data-name')
  9. var lphid=$(this).attr('data-hid')
  10. $('.schoolBm_form .lptitile').html(lpname);
  11. $('.schoolBm_form input[name="hid"]').val(lphid);
  12. $('.schoolBm').show(10)
  13. $('.schoolBm_bg').show()
  14. })
  15. $('.schoolBm_bg,.schoolBm_gb').on('click',function(){
  16. $('.schoolBm').hide()
  17. $('.schoolBm_bg').hide()
  18. })
  19. $('body').on('click','.blessing_buttom',function(){
  20. var lpname=$(this).attr('data-name')
  21. var lphid=$(this).attr('data-hid')
  22. $('.blessingBm_form .lptitile').html(lpname);
  23. $('.blessingBm_form input[name="hid"]').val(lphid);
  24. $('.blessingBm').show(10)
  25. $('.blessingBm_bg').show()
  26. })
  27. $('.blessingBm_bg,.blessingBm_gb').on('click',function(){
  28. $('.blessingBm').hide()
  29. $('.blessingBm_bg').hide()
  30. })
  31. $('body').on('click','.travel_buttom',function(){
  32. var lpname=$(this).attr('data-name')
  33. var lphid=$(this).attr('data-hid')
  34. $('.travelBm_form .lptitile').html(lpname);
  35. $('.travelBm_form input[name="hid"]').val(lphid);
  36. $('.travelBm').show(10)
  37. $('.travelBm_bg').show()
  38. })
  39. $('.travelBm_bg,.travelBm_gb').on('click',function(){
  40. $('.travelBm').hide()
  41. $('.travelBm_bg').hide()
  42. })
  43. $('body').on('click','.cent_bm',function(){
  44. $('.Hgift').show(10)
  45. $('.Hgift_bg').show()
  46. })
  47. $('.Hgift_bg,.Hgift_gb').on('click',function(){
  48. $('.Hgift').hide()
  49. $('.Hgift_bg').hide()
  50. })
  51. var _m=1
  52. $('.ztfooter_bm_main .city_m').on('click',function(){
  53. if (_m==1) {
  54. $('.ztfooter_bm_main .city_list').show(10)
  55. _l=2
  56. }else if (_m==2) {
  57. $('.ztfooter_bm_main .city_list').hide(0)
  58. _m=1;
  59. }
  60. })
  61. $('.ztfooter_bm_main .city_list').on('click','a',function(){
  62. var cityName=$(this).text();
  63. $(this).addClass('on').siblings().removeClass('on')
  64. $('.ztfooter_bm_main .city_m span').html(cityName)
  65. $('.ztfooter_bm_main input[name="intention_city"]').val(cityName);
  66. $('.ztfooter_bm_main .city_list').hide()
  67. _m=1;
  68. })
  69. var _l=1
  70. $('.Hgift_form .city_m').on('click',function(){
  71. if (_l==1) {
  72. $('.Hgift_form .city_list').show(10)
  73. _l=2
  74. }else if (_l==2) {
  75. $('.Hgift_form .city_list').hide(0)
  76. _l=1;
  77. }
  78. })
  79. $('.Hgift_form .city_list').on('click','a',function(){
  80. var cityName=$(this).text();
  81. $(this).addClass('on').siblings().removeClass('on')
  82. $('.Hgift_form .city_m span').html(cityName)
  83. $('.Hgift_form input[name="intention_city"]').val(cityName);
  84. $('.Hgift_form .city_list').hide()
  85. _l=1;
  86. })
  87. // 右边悬挂
  88. $(window).scroll(function (){
  89. var st = $(this).scrollTop();
  90. if(st >300){
  91. $('.rightnav').show();
  92. }else{
  93. $('.rightnav').hide();
  94. }
  95. });
  96. $('.nav_list a').on('click',function(){
  97. $(this).addClass('on').siblings().removeClass('on')
  98. })
  99. // 报名提交事件
  100. PublicAction.AjaxSend(
  101. {
  102. CORID:'buttom_tj', /*操作ID*/
  103. }
  104. );
  105. $('body .submit_area .buttom_tj').on('click',function(){
  106. // console.log('333')
  107. setTimeout(function(){
  108. var _html = $('body .alert-container .alert-content').html();
  109. // console.log('222')
  110. if(_html == '提交成功'){
  111. $('.schoolBm').hide()
  112. $('.schoolBm_bg').hide()
  113. $('.blessingBm').hide()
  114. $('.blessingBm_bg').hide()
  115. $('.travelBm').hide()
  116. $('.travelBm_bg').hide()
  117. $('body input[type="text"]').val('');
  118. $('.ztfooter_bm_main .show_l span').html('请选择您感兴趣的国家')
  119. $('.Hgift_form .show_l span').html('请选择您感兴趣的国家')
  120. $('.ztfooter_bm_main .city_main a').removeClass('on')
  121. $('.Hgift_form .city_main a').removeClass('on')
  122. }
  123. },2000)
  124. })
  125. })